How do you calculate the area under the ROC curve in R?

How do you calculate the area under the ROC curve in R?

How to Calculate AUC (Area Under Curve) in R

  1. Step 1: Load the Data. First, we’ll load the Default dataset from the ISLR package, which contains information about whether or not various individuals defaulted on a loan.
  2. Step 2: Fit the Logistic Regression Model.
  3. Step 3: Calculate the AUC of the Model.

Is C-statistic the same as AUC?

Harrel’s concordance index C is defined as the proportion of observations that the model can order correctly in terms of survival times. When censoring is observed the statistic only includes those patient pairs for which valid comparisons can be made. Sometimes C is called the AUC.

Is the area under the ROC curve the same as the C statistic?

Yes, the area under the ROC curve and the C-statistic are the same thing. I am not familiar with the user-written program you are referring to, so I cannot comment why it gives a different result. The official Stata -lroc- program has been around for a very long time, so it would be surprising if it had an uncorrected error.

How to interpret the AUC of a logistic regression?

A model with low sensitivity and low specificity will have a curve that is close to the 45-degree diagonal line. The AUC (area under curve) gives us an idea of how well the model is able to distinguish between positive and negative outcomes. The AUC can range from 0 to 1.

How to calculate the area under the curve ( AUC )?

The estimated AUC from the smoothed ROC is 0.9107, similar to, but slightly larger than, the AUC from the unsmoothed ROC (if you look at the figure, you can easily see why it’s larger). (Though we really have too few possible distinct test result values to calculate a smooth AUC).

What should the AUC of a ROC curve be?

Unlike accuracy, ROC curves are insensitive to class imbalance; the bogus screening test would have an AUC of 0.5, which is like not having a test at all. In this post I’ll work through the geometry exercise of computing the area, and develop a concise vectorized function that uses this approach.