Mercurial > repos > testtool > survival
comparison survival/survival.R @ 31:ef13fa666e0e draft default tip
Uploaded
author | testtool |
---|---|
date | Tue, 03 Oct 2017 09:40:44 -0400 |
parents | b4d7a110dd32 |
children |
comparison
equal
deleted
inserted
replaced
30:e5b8435e5379 | 31:ef13fa666e0e |
---|---|
14 res <- summary(tofit,times=c(1,2,3)) | 14 res <- summary(tofit,times=c(1,2,3)) |
15 save.df <- as.data.frame(res[c("strata", "time", "n.risk", "n.event", "surv", "std.err", "lower", "upper")]) | 15 save.df <- as.data.frame(res[c("strata", "time", "n.risk", "n.event", "surv", "std.err", "lower", "upper")]) |
16 write.csv(save.df, fit) | 16 write.csv(save.df, fit) |
17 | 17 |
18 png(png) | 18 png(png) |
19 plot(tofit,xlab="Survival (days)", ylab="Survival", lwd=2,xlim=c(0,1900),ylim=c(0.3,1),col=c("red","blue")) | 19 plot(tofit,xlab="Time", ylab="Survival", lwd=2,xlim=c(0,1900),ylim=c(0.3,1),col=c("red","blue")) |
20 legend("topright",legend=c("low","high"),lty=c(1,1), | 20 legend("topright",legend=c("low","high"),lty=c(1,1), |
21 lwd=c(2.5,2.5),col=c("red","blue")) | 21 lwd=c(2.5,2.5),col=c("red","blue")) |
22 dev.off() | 22 dev.off() |
23 | 23 |