Skip to content
Prev 387738 / 398502 Next

Plotting adjusted KM curve

On 2021-04-05 03:34, Sorkin, John wrote:
You should look at

?survfit.coxph

in the survival package, especially the 'newdata' argument.
Then I guess that you should stratify on sex:

fit <- coxph(surv_object ~ age + strata(sex), data = mydata)

sfit <- survfit(fit, newdata = data.frame(age = 65))
plot(sfit)

HTW, G?ran