#To get the test statistics for the difference between AUC(y=x[,1])
#and AUC(y=x[,2])
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)
v2=c(2)
output=auc_diff(dat,v1,v2,nv,kv)
#R2ROC output
#output$mean_diff (mean difference of AUC1 and AUC2)
#0.1756046
#output$var (variance of AUC difference)
#9.274356e-05
#output$upper_diff (upper limit of 95% CI for difference)
#0.1944801
#output$lower_diff (lower limit of 95% CI for difference)
#0.1567292
#output$p (two-tailed P-value for the differences is
#significantly different from zero)
#2.747031e-74
#output$p_one_tail (one-tailed P-value for the differences
#is significantly different from zero)
#1.373515e-74
#To get the test statistics for the difference between
#AUC(y=x[,1]+x[,2]) and AUC(y=x[,2])
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,2)
v2=c(2)
output=auc_diff(dat,v1,v2,nv,kv)
#R2ROC output
#output$mean_diff (mean difference of AUC1 and AUC2)
#0.1793682
#output$var (variance of AUC difference)
#0.0001190366
#output$upper_diff (upper limit of 95% CI for difference)
#0.2007526
#output$lower_diff (lower limit of 95% CI for difference)
#0.1579839
#output$p (two-tailed P-value for the differences is
#significantly different from zero)
#9.87014e-61
#output$p_one_tail (one-tailed P-value for the differences
#is significantly different from zero)
#4.93507e-61
#output$heller_p (two-tailed P-value based on Hellers test
#for the differences is significantly different from zero)
#4.2085e-237
#output$heller_upper_diff (upper limit of 95% CI for
#difference based on Hellers test)
#0.2013899
#output$heller_lower_diff (lower limit of 95% CI for
#difference based on Hellers test)
#0.1586212
Run the code above in your browser using DataLab