[R] Off-topic: simulate time dependent covariates

Frank E Harrell Jr f.harrell at vanderbilt.edu
Sun Jul 22 14:56:11 CEST 2007

Jin Lo wrote:
> Dear R friends,
> this is an off-topic question. Could you please point
> me in ways (e.g., references or even R code) for
> simulating time varying covariates in a survival
> analysis setting.
> Thanks in advance for any responses.
> yours sincerely,
> Jin

I'm not sure if this article addresses time-dependent covariates but it 
may be worth a look:

   author = 		 {Bender, Ralf and Augustin, Thomas and Blettner, Maria},
   title = 		 {Generating survival times to simulate {Cox}
proportional hazards models},
   journal = 	 Stat in Med,
   year = 		 2005,
   volume =		 24,
   pages =		 {1713-1723},
   annote =		 {simulation setup;simulating survival
times;censoring;Cox model;errata 25:1978-1979}

The spower function in the Hmisc package can simulate data for a 
non-constant-hazard ratio treatment effect.  The user specifies the 
hazard ratio as a function of time.

Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University

More information about the R-help mailing list