|
| 1 | +library("PredictABEL") |
| 2 | + |
| 3 | +model.glm0 <- (bayesglm(phen ~ LINE.1,family=binomial,data=data,na.action=na.omit)) |
| 4 | +model.glm1 <- (bayesglm(phen ~ cg12071888,family=binomial,data=data,na.action=na.omit)) |
| 5 | +model.glm2 <- (bayesglm(phen ~ AHRR,family=binomial,data=data,na.action=na.omit)) |
| 6 | +model.glm3 <- (bayesglm(phen ~ ARRB2,family=binomial,data=data,na.action=na.omit)) |
| 7 | +model.glm4 <- (bayesglm(phen ~ FGF8,family=binomial,data=data,na.action=na.omit)) |
| 8 | +model.glm5 <- (bayesglm(phen ~ cg12071888+AHRR+ARRB2+FGF8,family=binomial,data=data,na.action=na.omit)) |
| 9 | + |
| 10 | +pred0 <- predRisk(model.glm0) |
| 11 | +pred1 <- predRisk(model.glm1) |
| 12 | +pred2 <- predRisk(model.glm2) |
| 13 | +pred3 <- predRisk(model.glm3) |
| 14 | +pred4 <- predRisk(model.glm4) |
| 15 | +pred5 <- predRisk(model.glm5) |
| 16 | + |
| 17 | +par(cex.lab=1.5,cex.axis=1.5,lwd=1.5) |
| 18 | +plotROC(data=data,cOutcome=2,predrisk=cbind(pred0,pred1,pred2,pred3,pred4,pred5)) |
| 19 | +legend.text<-c("LINE-1","BARHL2","AHRR","ARRB2","FGF8","BAAF") |
| 20 | +legend("bottomright",cex=1.5,legend=legend.text,lty=1:6,col=1:6,bty="n") |
| 21 | + |
| 22 | +tiff("multi-AUC-splited.tiff") |
| 23 | +pdf("multi-AUC-splited.pdf") |
| 24 | +par(mfrow=c(2,3),cex.lab=1.5,cex.axis=1.5,lwd=1.5) |
| 25 | +plotROC(data=data,cOutcome=2,predrisk=cbind(pred0),plottitle="LINE-1") |
| 26 | +plotROC(data=data,cOutcome=2,predrisk=cbind(pred1),plottitle="BARHL2") |
| 27 | +plotROC(data=data,cOutcome=2,predrisk=cbind(pred2),plottitle="AHRR") |
| 28 | +plotROC(data=data,cOutcome=2,predrisk=cbind(pred3),plottitle="ARRB2") |
| 29 | +plotROC(data=data,cOutcome=2,predrisk=cbind(pred4),plottitle="FGF8") |
| 30 | +plotROC(data=data,cOutcome=2,predrisk=cbind(pred5),plottitle="BAAF") |
| 31 | +dev.off() |
| 32 | + |
| 33 | +predicted.value = predict(model.glm5,type=c("response")) |
| 34 | +predicted.data = data.frame(Type=data$phen, predicted.value) |
| 35 | +logistic.rocobj = roc(predicted.data$Type, predicted.data$predicted.value,smooth = FALSE) |
| 36 | +logistic.rocdata = data.frame(Sens = logistic.rocobj$sensitivities, Spec = logistic.rocobj$specificities) |
| 37 | +AUC= logistic.rocobj$auc[[1]] |
| 38 | +logistic.rocdata[,3] = logistic.rocdata[,1] + logistic.rocdata[,2] |
| 39 | +seq.max = which(logistic.rocdata[,3] == max(logistic.rocdata[,3])) |
| 40 | +Sens= logistic.rocdata[seq.max[1],1] |
| 41 | +Spec= logistic.rocdata[seq.max[1],2] |
| 42 | +ACC=c(Sens,Spec, AUC) |
| 43 | +ACC |
0 commit comments