I am following the lung example from survminer package in 3.5.1. The initial code is below:
library("survminer")
require("survival")
fit <- survfit(Surv(time, status) ~ sex, data = lung)
ggsurvplot(fit, data = lung)
This plots the survival by sex, all fine. It then occurred to me that I want to just graph sex=1 or sex=2 only. How do I only plot a subset of the data from fit?
...data = subset(lung, sex==1)
– Parfait