Skip to content

How to generate a prediction equation for a stratified survival model that was fitted by cph() in Design package

3 messages · Frank E Harrell Jr, Yu, Changhong

#
Dear all,

I used cph() function from Frank harrell's Design package to create a
survival model, then used functions 'Function' and 'sascode' to generate
prediction equation based on the saved survival model. But it failed. I
included a stratified variable in the model. If I removed the
stratification, they were working well. Does that mean that function
'Function' doesn't accept a stratified model?

Any thoughts on this will be appreciated. Thanks.


Changhong

===================================

P Please consider the environment before printing this e-mail

Cleveland Clinic is ranked one of the top hospitals
in America by U.S. News & World Report (2008).  
Visit us online at http://www.clevelandclinic.org for
a complete listing of our services, staff and
locations.


Confidentiality Note:  This message is intended for use\...{{dropped:13}}
#
Yu, Changhong wrote:
It is supposed to work for that case.  Please send trivial example code 
with data defined in the code that replicates the problem you are 
seeing, and I'll debug.

Frank

  
    
#
Dear Dr. Harrell,

Thanks for response so quickly. Here is example code to illustrate the
problem.
+               rep=TRUE, prob=c(.6, .4)))
surv=TRUE)
y=TRUE,surv=TRUE)
function(age = 48.800654,sex = "Male") {0.28612987-0.017321951*
age+0.00012586581*pmax(age-29.600456,0)^3-0.00046285671*pmax(age-44.2731
98,0)^3+0.00042111763*pmax(age-53.769262,0)^3-8.4126731e-05*pmax(age-69.
855597,0)^3-0.64448916*(sex=="Male") }
<environment: 0x02c2aef4>
Error in Nam[[i]] : subscript out of bounds

I am using Windows R ( version 2.6.0 2007-10-03).

Best regards,

Changhong Yu

-----Original Message-----
From: Frank E Harrell Jr [mailto:f.harrell at vanderbilt.edu] 
Sent: Thursday, December 11, 2008 6:58 PM
To: Yu, Changhong
Cc: r-help at r-project.org
Subject: Re: [R] How to generate a prediction equation for a stratified
survival model that was fitted by cph() in Design package
Yu, Changhong wrote:
generate
I
It is supposed to work for that case.  Please send trivial example code 
with data defined in the code that replicates the problem you are 
seeing, and I'll debug.

Frank
use\...{{dropped:13}}
http://www.R-project.org/posting-guide.html