11.8 KM curve stratified by sex
Next we create Kaplan-Meier survival curves that are stratified by sex
, in order to reproduce Figure 11.3.
<- survfit(Surv(time, status) ~ sex, data = BrainCancer)
fit.sex plot(fit.sex, xlab = "Months",
ylab = "Estimated Probability of Survival", col = c(2,4))
legend("bottomleft", levels(BrainCancer$sex), col = c(2,4), lty = 1)