s-news
[Top] [All Lists]

coxph() with time-dependent covariate

To: <s-news@lists.biostat.wustl.edu>
Subject: coxph() with time-dependent covariate
From: "Osman" <osman.al.radi@utoronto.ca>
Date: Tue, 20 May 2003 15:47:22 -0400
Hello,
 
This is a follow-up about my question about including time-dependent covariates in coxph() or cph().. Thanks mainly to help from prof. Frank Harrell I found the following:
 
1) you need to create an expanded data-set: very easy with a function provided in s-news called expand.breakpoints() (PS: many thanks to author John Maindonald)
 
2) you need to create the time interaction variable before cph() or coxph():
 
    time.rx<-rx*Tstop  # Tstop is a variable created by expand.breakpoints()
 
3) use coxph() or cph() :
 
f<-cph(Surv(Tstart,Tstop,status)~age+sex+dm+rx+time.rx,x=T,y=T)
 
this works fine as opposed to
 
f<-cph(Surv(Tstart,Tstop,status)~age+sex+dm+rx+rx:Tstop,x=T,y=T)
 
will give a singularity error
 
4) Unfortunately validate() calibrate() functions which are great functions in Prof. Harrell's  Design library no longer work..
 
If any one is aware of a validation and calibration method that would work with coxph() with time-dependent covariates please let me know..
 
Osman   
 
 
 
  On Sat, 10 May 2003 23:59:40 -0400
Osman Al-Radi <osman.al.radi@utoronto.ca> wrote:

>
> Dear Prof. Harrell,
>
> Thank you for your quick response (even during the weekend)..
>
> I do not want to stratify by treatment (rx) because the model in this case
> dose not allow inferences about rx which is the aim of the study..
>
> The second option in Therneau and Grambsch is to partition the follow-up
> time.. essentially get two or more models.. Unfortunately this reduces the
> number of events in each phase of follow-up and I can not afford that in
> terms of the number of dfs I need to adjust for baseline differences in this
> observational study..
>
> The third option which is the basis of my question is to model the
> non-proportionality by including a time-dependent covariate.. here the T&G
> book suggest using SAS PHREG to include such a variable (a function of the
> survival time).. I may have to do that but I was wondering if there is a way
> of doing that in S (I do not believe that is described in the book)
>
> I am grateful for your help..
>
> Osman
>
>

Inference will not be easy for the effect of rx if you use time-dependent covariates.  And depending on how you slice the time axis and model the interaction between time and rx, the "time-slicing" approach using the coxph function will have the same spending of d.f. and increase in variance as the continuous time interaction method that is easy to do with SAS PHREG.  Note also that you can have continuous time interactions with coxph; it will just require the creation of a large dataset.

Frank
>
>
>
>
> ----- Original Message -----
> From: "Frank E Harrell Jr" <fharrell@virginia.edu>
> To: "Osman Al-Radi" <osman.al.radi@utoronto.ca>
> Cc: <s-news@lists.biostat.wustl.edu>
> Sent: Saturday, May 10, 2003 9:06 PM
> Subject: Re: [S] non-proportioana hazards for the treatment effect
>
>
> > On Sat, 10 May 2003 12:29:14 -0400
> > Osman Al-Radi <osman.al.radi@utoronto.ca> wrote:
> >
> > > Hi
> > >
> > > f<-cph(Surv(time.status)~age+sex+dm+rx,x=T,y=T)
> > >
> > > The main treatment variable (rx) fails the PH assumption test of
> cox.zph() in a cph() model..
> > >
> > > I would like to model the non-proportional effect..
> > >
> > > If I include rx:time interaction the model fails to converge!
> > >
> > > How can I model the non-proportionality ? I do not want to subset by
> time because this results in two or more models with less events in each and
> I do not have enough dfs..
> > >
> > > I would appreciate any suggestions..
> > >
> > > Osman
> >
> > When posting to S-news it is best to speak of the most basic functions.
> As cph (in the Design library) uses coxph (in the survival library) it would
> be better to state you question more generally using coxph.
> >
> > The simplest way to allow for non-proportional hazards for a categorical
> variable such as rx is to stratify on it (strata(rx) for coxph, strat(rx)
> for cph, an unfortunate complication).  And note that if you do not want to
> use stratification, you can't just interact follow-up time with a covariate
> if you want to use time-dependent covariates.  See coxph documentation or
> the Therneau & Grambsch book for how to do that.
> >
> > ---
> > Frank E Harrell Jr              Prof. of Biostatistics & Statistics
> > Div. of Biostatistics & Epidem. Dept. of Health Evaluation Sciences
> > U. Virginia School of Medicine  http://hesweb1.med.virginia.edu/biostat
> >
>


---
Frank E Harrell Jr              Prof. of Biostatistics & Statistics
Div. of Biostatistics & Epidem. Dept. of Health Evaluation Sciences
U. Virginia School of Medicine  http://hesweb1.med.virginia.edu/biostat
--------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu.  To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
the BODY of the message:  unsubscribe s-news
<Prev in Thread] Current Thread [Next in Thread>
  • coxph() with time-dependent covariate, Osman <=