[R] Problem with plotting survival predictions from cph model
figurski at mail.med.upenn.edu
Thu May 27 19:32:59 CEST 2010
Actually, I have another problem with the same data - this time with
plotting simple KM lines. The dataset is attached.
In this excercise I was testing two ways of representing time from the
previously attached interval dataset. Here t1 is the "stop" time at the
last interval for each patient, and t2 is the average of "start" and
"stop" at the last interval.
Now, if I use t1 as time:
f = survfit(Surv(t1, status)~P3>16, data=x)
I get a nice plot, however when I write:
f = survfit(Surv(t2, status)~P3>16, data=x)
I get an error: "Error in rep(x[dupy], c(1, rep(2, n2 - 1))) : invalid
I can't understand why this would work with t1, but not with t2. Is
there something I am doing incorrectly or another bug?
Michal J. Figurski, PhD
HUP, Pathology & Laboratory Medicine
Biomarker Research Laboratory
3400 Spruce St. 7 Maloney
Philadelphia, PA 19104
tel. (215) 662-3413
More information about the R-help