# From Harell, 'Regression Modeling Strategies' library(Hmisc,T) library(Design,T) group <- as.factor(rep(c('Arm 1','Arm 2'), c(19,21))) days <- c(143,164,188,188,190,192,206,209,213,216,220,227,230, 234,246,265,304,216,244,142,156,163,198,205,232,232, 233,233,233,233,239,240,261,280,280,296,296,323,204,344) death <- rep(1,40) death[c(18,19,39,40)] <- 0 units(death) <- 'Days' S <- Surv(days, death) f <- survfit(S~group, type='fleming') #png('C:/Research/Graphics/Graphs4Display/webpages/classes/pages/images/survplotRMS.png', # width=500, height=500) survplot(f, conf='none', col=c('red', 'black'), n.risk=TRUE, label.curves=FALSE, lty=c(1,1), lwd=2, cex=1.5) text(x=200, y=0.4, 'Arm 1', col='red', cex=2) text(x=270, y=0.55, 'Arm 2', col='black', adj=1, cex=2) #dev.off()