[R] Problem with plotting survival predictions from cph model

Michal Figurski figurski at mail.med.upenn.edu
Thu May 27 18:04:46 CEST 2010

Well, I am very proud of myself. Here is something to help you.

The dataset is attached, with "anonymized" column names. The code to 
reproduce the error is below:

d <- datadist(x)
f <- cph(Surv(start,stop,status)~P1*P2 + P3, data=x, x=T, y=T, surv=T)
plot(Predict(f))		# Works fine
plot(Predict(f, time=3))	# Produces the error

Best regards,

Michal J. Figurski, PhD
HUP, Pathology & Laboratory Medicine
Biomarker Research Laboratory
3400 Spruce St. 7 Maloney
Philadelphia, PA 19104
tel. (215) 662-3413

On 2010-05-27 10:44, Terry Therneau wrote:
>> but 'plot(Predict(f, time=3))' throws an error:
>> "Error in summary.survfit(g, print.it = FALSE, times = times) :
>>     object 'n.enter' not found"
> Congratulations!  You just discovered a new, never-before-encountered
> bug in the survival package.  I should have a repair posted to Rforge by
> the end of the day.
> Terry Therneau (author of the package)

More information about the R-help mailing list