Skip to content
Back to formatted view

Raw Message

Message-ID: <Pine.A41.4.61b.0411030818530.320496@homer04.u.washington.edu>
Date: 2004-11-03T16:24:20Z
From: Thomas Lumley
Subject: time dependency of Cox regression
In-Reply-To: <41883A7C.2070508@vanderbilt.edu>

> array chip wrote:
>> Hi,
>> 
>> How can I specify a Cox proportional hazards model
>> with a covariate which i believe its strength on
>> survival changes/diminishes with time? The value of
>> the covariate was only recorded once at the beginning
>> of the study for each individual (e.g. at the
>> diagnosis of the disease), so I do not have the time
>> course data of the covariate for any given individual.
>> For example, I want to state at the end of the
>> analysis that the hazard ratio of the covariate is 6
>> at the beginning, decrease to 3 after 2 years and
>> decrease to 1.5 after 5 years.


If you fit a Cox model with the fixed covariate, plot(cox.zph(model)) will 
show you an estimate of how the log hazard ratio changes over time, with 
pointwise confidence intervals.

If you want more precise estimates and confidence intervals you can split 
up your covariate into a set of time-dependent covariates.

If you wanted a time period for each year up to 6 years you would make 6 
time dependent covariates, looking like

  x 0 0 0 0 0
  0 x 0 0 0 0
  0 0 x 0 0 0
  0 0 0 x 0 0
  0 0 0 0 x 0
  0 0 0 0 0 x

and have (up to) six records per person.  The survSplit() function in the 
survival package will do the splitting, you then need to set the 
appropriate terms to zero and fit the model.

 	-thomas