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

2010-03-30 Thread Wittner, Ben, Ph.D.
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




The information in this e-mail is intended only for the ...{{dropped:11}}

__
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.


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

2010-03-30 Thread Frank E Harrell Jr

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 ChairmanSchool 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.