auc_var {R2ROC} | R Documentation |
auc_var function
Description
This function estimates var(AUC(y~x[,v1])) where AUC is the Area Under ROC curve of the model, y is N by 1 matrix having the dependent variable, and x is N by M matrix having M explanatory variables. v1 indicates the ith column in the x matrix (v1 can be multiple values between 1 - M, see Arguments below)
Usage
auc_var(dat, v1, nv, kv)
Arguments
dat |
N by (M+1) matrix having variables in the order of cbind(y,x) |
v1 |
This can be set as v1=c(1), v1=c(1,2) or possibly with more values |
nv |
Sample size |
kv |
Population prevalence |
Value
This function will test the null hypothesis for AUC. To get the test statistics for AUC(y~x[,v1]). The outputs are listed as follows.
auc |
AUC |
var |
Variance of AUC |
upper_auc |
Upper limit of 95% CI for AUC |
lower_auc |
Lower limit of 95% CI for AUC |
p |
two tailed p-value |
p_one_tail |
one tailed p-value |
Examples
#To get the AUC for AUC(y=x[,1])
dat=dat1 #(this example embedded within the package)
nv=length(dat$V1)
kv=sum(dat$V1)/length(dat$V1)# pop. prevalence estimated from data
#R2ROC also allows users to estimate AUC using pre-adjusted phenotype
#In that case, users need to specify kv
#eg. kv=0.10 for dat2 (dat2 embedded within the package)
v1=c(1)
output=auc_var(dat,v1,nv,kv)
#R2ROC output
#output$auc (AUC)
#0.7390354
#output$var (variance of AUC)
#7.193337e-05
#output$upper_auc (upper limit of 95% CI for AUC)
#0.7556589
#output$lower_auc (lower limit of 95% CI for AUC)
#0.7224119
#output$p
#9.28062e-175 (two tailed P-value for the AUC is significantly
#different from 0.5)
#output$p_one_tail (one tailed P-value for the AUC is significantly
#different from 0.5)
#4.64031e-175
[Package R2ROC version 1.0.1 Index]