#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
Run the code above in your browser using DataLab