library(regplot) library("survival") library("survminer") library(rms) setwd("") rt<-read.table("input.txt",sep="\t",header=T,check.names=F,row.names=1) str(rt) res.cox <- lrm(MDR ~ CREA+Fever+ FIB+Invasiveoperation+ LYMPH+ Age + DD +APTT , data = rt) nom1<-regplot(res.cox, clickable=TRUE, points=TRUE, rank="sd",failtime = c(365,1095),prfail = T) nom2<-regplot(res.cox,observation=rt[3,], clickable=TRUE, points=TRUE, rank="sd",failtime = c(365,1095),droplines=T,prfail = F, other=(list(bvcol="red",sq="green",obscol="blue"))) ddist <- datadist(rt) options(datadist="ddist") mynom<- nomogram(res.cox, fun=plogis,fun.at=c(0.0001,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,0.9999), lp=F, funlabel="Risk of nonadherence") pdf("Nom.pdf",10,8) plot(mynom) dev.off()