Description Usage Arguments Details See Also Examples
The function allows to calculate the AUC of a (binary) Logistic Regression model, adjusted for optimism.
1 |
data: |
dataframe containing the dataset (note: the Dependent Variable must be stored in the first column to the left). |
fit: |
object returned from glm() function. |
B: |
desired number of bootstrap resamples (suggested values: 100 or 200). |
The function performs an internal validation of a model via a bootstrap procedure (devised by Harrell and colleagues), which enables to estimate the degree of optimism of a fitted model and the extent to which the model will be able to generalize outside the training dataset.
If you want more info, you can refer to this website (http://thestatsgeek.com/2014/10/04/adjusting-for-optimismoverfitting-in-measures-of-predictive-ability-using-bootstrapping/), and/or read the following interesting article (in which the bootstrap procedure is described at page 776):
http://thestatsgeek.com/2014/10/04/adjusting-for-optimismoverfitting-in-measures-of-predictive-ability-using-bootstrapping/
The returned boxplots represent:
-the distribution of the AUC value in the bootstrap sample (auc.boot), which represents "an estimation of the apparent performance" (according to the aforementioned reference);
-the distribution of the AUC value deriving from the model fitted to the bootstrap samples and evaluated on the original sample (auc.orig), which represents the model performance on independent data.
At the bottom of the chart, the apparent AUC (i.e., the value deriving from the model fitted to the original dataset) and the AUC adjusted for optimism are reported.
1 2 3 | data(log_regr_data) # load the sample dataset
model <- glm(admit ~ gre + gpa + rank, data = log_regr_data, family = "binomial") # fit a logistic regression model, storing the results into an object called 'model'
aucadj(data=log_regr_data, fit=model, B=200)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.