请教各位大侠如何通过bootstrap方法得到AUC的95%CI及其p值。
现找到一段程序,但是看不懂:
# Bootstrap 95% CI for R-Squared
library(boot)
# function to obtain R-Squared from the data
rsq <- function(formula, data, indices) {
d <- data[indices,] # allows boot to select sample
fit <- lm(formula, data=d)
return(summary(fit)$r.square)
}
# bootstrapping with 1000 replications
results <- boot(data=mtcars, statistic=rsq,
R=1000, formula=mpg~wt+disp)
我的程序中已作出AUC趋势图,但是得不到AUC的95%CI及p值,模仿上面编程出不来结果。
我的程序如下(无AUC的95%CI及p值):
fit<-coxph(Surv(survival.time,survival.status)~IPI+β2m,na.action=na.omit)
eta0<-fit$linear.predictor
AUC.CC=risksetAUC(Stime=survival.time,
status=survival.status, marker=eta, method="Cox", tmax=40)