[R] Paik, et al., NEJM, 2004, Fig. 4, rate of event at 10 years as a function of covariate

Frank E Harrell Jr f.harrell at Vanderbilt.Edu
Tue Mar 30 15:16:15 CEST 2010


Wittner, Ben, Ph.D. wrote:
> Does anyone know how to make a plot like Fig. 4 of Paik, et al., New England
> Journal of Medicine, Dec. 30, 2004?
> 
> Given survival data and a covariate, they plot a curve giving "Rate of Distant
> Recurrence at 10 Yr (% of patients)" on the y-axis versus the covariate on the
> x-axis. They also plot curves giving a 95% confidence interval.
> 
> Thanks very much.
> 
> -Ben
> 
> 
> 

Such a plot is easy to do with the rms package if using a Cox or 
accelerated failure time model, e.g.

require(rms)
dd <- datadist(mydata); options(datadist='dd')
f <- cph(Surv(rtime, event) ~ rcs(covariate,4) + sex + ..., x=TRUE, 
y=TRUE)  # restricted cubic spline with 4 knots
plot(Predict(f, covariate, sex, time=10))  # separate curves for male 
and female; omit sex to make one curve; add age=50 to predict for a 50 
year old



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



More information about the R-help mailing list