varAUC: Calculate an unbiased variance estimator of AUC

View source: R/varAUC.R

varAUCR Documentation

Calculate an unbiased variance estimator of AUC

Description

Calculate an unbiased variance estimator of AUC

Usage

varAUC(p_pred, label_true, B = Inf)

Arguments

p_pred

A vector of the predicted probabilities for the observations in the data set

label_true

A vector of the true labels in the data set, coded as 1 (positive) and 0 (negative)

B

The number of random partitions to use in the partition-resampling scheme. If B is set to Inf or it is ommited, the exact unbiased variance estimation formula without the partition resampling scheme is realized.

Value

The value of the AUC variance estimator

References

Q. Wang and A. Guo (2020). An efficient variance estimator of AUC with applications to binary classification. Statistics in Medicine 39 (28): 4281-4300. DOI: 10.1002/sim.8725.

Examples

library(aucvar)
my_data <- na.omit(breastcancer) # Omit NA values
my_model <- glm(Class~`Clump Thickness`+ `Uniformity of Cell Size` +
`Uniformity of Cell Shape`+ `Marginal Adhesion` + `Single Epithelial Cell Size` +
`Bare Nuclei` + `Bland Chromatin` + `Normal Nucleoli` + `Mitoses`,
family=binomial(link="logit"), data=my_data)
predictions <- predict(my_model, type="response")
varAUC(predictions, my_data$Class, 10^3)


fmoyaj/aucvar documentation built on Nov. 28, 2023, 10:50 p.m.