auc: Calculate and compare AUC estimate for clustered data

Description Usage Arguments Value References Examples

Description

This function can be used to calculate and compare AUC estimates. If a single set of test measurements is provided, the corresponding AUC and variance values are computed. If two sets of test measurements are provided, a significance test for a difference in AUC estimates is also computed. Optionally, the previous can also be computed in the presence of clustered data per Obuchowski (1997). This function implicity assumes that higher values of test_1 and test_2 are correlated with the positive gold standard (status = TRUE)

Usage

1
auc(test_1, test_2 = NULL, status, cluster = NULL)

Arguments

test_1

the set of test measurments for which the AUC should be computed

test_2

a second set of test measurments for which the AUC is computed and compared to the first set of test measurements

status

a logical vector representing the gold standard negative/positive status of an observaiton

cluster

variable identifying clusters

Value

a list containing

auc

a vector of AUC estimates

var

the individual variance estimate or covariance matrix

test_stat

the test statistic for comparing the AUC estimates, distributed standard normal

p_value

the p-value associated with the AUC test comparison (2-sided)

References

Obuchowski N.A. (1997) Nonparametric Analysis of clustered ROC Curve Data. Biometrics, 53, 567-578.

DeLong E.R., DeLong D.M, Clarke-Pearson D.L. (1988) Comparing the areas under two or more correlated receiver operating characteristic curves: a nonparametric approach. Biometrics, 44, 837-845.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
library(fastAUC)

n_obs <- 10000
n_clust <- 100

cluster <- sample(x = 1:n_clust, size = n_obs, replace = T)
status <- as.logical(rbinom(n = n_obs, size = 1,  prob = 0.3))
test_1 <- ifelse(status,
                 rnorm(n = n_obs, mean = 15, sd = 20),
                 rnorm(n = n_obs,mean = 10, sd = 20))
test_2 <- ifelse(status,
                 rnorm(n = n_obs, mean = 20, sd = 20),
                 rnorm(n = n_obs,mean = 10, sd = 20))

auc(test_1 = test_1, status = status)

auc(test_1 = test_1, test_2 = test_2, status = status, cluster = cluster)

hild0146/fastAUC documentation built on May 6, 2019, 12:05 a.m.