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
Frank E Harrell Jr
2007-Jul-22 12:56 UTC
[R] Off-topic: simulate time dependent covariates
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, > > JinI'm not sure if this article addresses time-dependent covariates but it may be worth a look: @Article{ben05gen, 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