day1-叶必成
今天第一课
之前写的输出auc的代码
#取三个基因表达
yebicheng11 <- function(i){duoyinsu <- cbind(uniSigExp[,1:2],uniSigExp[,i])
multiCox=coxph(Surv(futime, fustat) ~ ., data = duoyinsu)
multiCox=step(multiCox,direction = "both")
duoyinsu1 <- cbind(out[,1:2],out[,i])
trainScore=predict(multiCox,type="risk",newdata=duoyinsu)
trainScore1=predict(multiCox,type="risk",newdata=duoyinsu1)
roczb1 <- cbind(duoyinsu1,trainScore1)
roc1=survivalROC(Stime=(roczb1$futime)/365, status=roczb1$fustat, marker = roczb1$trainScore1,
predict.time =1, method="KM")
roc2=survivalROC(Stime=(roczb1$futime)/365, status=roczb1$fustat, marker = roczb1$trainScore1,
predict.time =3, method="KM")
roc3=survivalROC(Stime=(roczb1$futime)/365, status=roczb1$fustat, marker = roczb1$trainScore1,
predict.time =5, method="KM")
finally1 <- cbind(paste(i[1],i[2],i[3]),roc1$AUC,roc2$AUC,roc3$AUC)
return(finally1)
}