library(survival)
plot(survfit(Surv(time,status)~stain, data=bcancer), col=1:2, xlab="Survival time (months)",
ylab="Survival")
legend("topright", legend=c("Negative staining","Positive staining"), col=1:2, lty=1,
bty="n")
Run the code above in your browser using DataLab