Eleni Rapsomaniki wrote:
I am using the package Design for survival analysis. I want to plot a simple Kaplan-Meier fit of survival vs. age, with age grouped as quantiles. I can do this:

survplot(survfit(Surv(time,status) ~ cut(age,3), data=veteran)

but I would like to do something like this:

survplot(survfit(Surv(time,status) ~ quantile(age,3), data=veteran) #will not work

ideally I would like to superimpose estimates from cph models, which automatically fit the 2nd to 4rth quantiles for age, so I need the age groups to be grouped the same.

Any help greatly appreciated!
Eleni Rapsomaniki

This will result in a poor fitting model and residual confounding (by only partially adjusting for a variable; you are assuming a piecewise flat model). Use Surv( ) ~ strat(cut2(age,g=3)) ...
For Design it is often better to do

ageg <- cut2(age,g=3)   # Donald Rumsfeld approach to using information
f <- cph(Surv( ) ~ strat(ageg), ...)

Frank


--
Frank E Harrell Jr   Professor and Chair           School of Medicine
                     Department of Biostatistics   Vanderbilt University

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to