[R] competing risk model with time dependent covariates under R or Splus

From: BXC (Bendix Carstensen) <bxc_at_steno.dk>
Date: Sun, 27 Jul 2008 16:24:12 +0200

This message was also sent to the MEDSTATS mailing list, so here is the reply I posted to that:


The machinery to use is to split follow-up time so finely that you can safely assume that rates are constant in each interval, and then just stuff it all into a Poisson model. This allows you to use any kind of time-dependent variables as well as accommodating competing risks.

In the Epi package (http://staff.pubhealth.ku.dk/~bxc/Epi/) on CRAN there is a machinery for representation and manipulation of multistate data (of which competing risks are a special case), see the function Lexis(). It also has a time-splitting function there, splitLexis().

If you take a look at practical 14 from this year's SPE course: http://staff.pubhealth.ku.dk/~bxc/SPE/2008/pracs.pdf there is an example that addresses the problem you are having, practical no. 14. If go to the folder
http://staff.pubhealth.ku.dk/~bxc/SPE/2008/R you will find the R-code that runs the solution to the practical. The data used is a part of the Epi-package, so you just have to load the Epi package first.

It is however not using the Fine/Gray approach, but is directly modelling the cause-specific rates taking time dependent covariates into account.

Best regards,

Bendix Carstensen
Senior Statistician
Steno Diabetes Center
Niels Steensens Vej 2-4
DK-2820 Gentofte
+45 44 43 87 38 (direct)
+45 30 75 87 38 (mobile)
bxc@steno.dk http://www.biostat.ku.dk/~bxc

> -----Original Message-----
> From: MedStats_at_googlegroups.com
> [mailto:MedStats_at_googlegroups.com] On Behalf Of pguardio
> Sent: 26. juli 2008 22:47
> To: MedStats
> Subject: {MEDSTATS} competing risk model with time dependent
> covariates under R or Splus
> Dear members,
> is there a way to perform a competing risk model which can
> handle time dependent covariates under either R ou SPlus ?
> my main covariate (additional treatment to patients) violates
> the proportional hazards assumption, its effect being
> observed after one year of the main treatment, not before
> (this is expected / makes sense on a clinical point of view).
> So I was planning to use a time dependent Cox model with 2
> time intervals for patients: < > 1 year etc...
> However, I need to use a competing risk model because a large
> number of patients dies from early toxicity from main
> treatment (not related to the additional treatment I m
> evaluating the effect) or from events unrelated to the
> disease or the treatments (elderly patients).
> Therefore, to analyze the effect of my covariate of interest
> on disease free survival and relapse incidence, I d like to
> use a competing risk model such as the Gray CMPRSK.
> However, I cannot have multiple "lines" for the same patient
> (cluster function is not allowed in CMPRSK) with this package
> (for time dep covariates I need 1 or 2 lines with same Id /UPN).
> Does anyone knows how can I manage this in CMPRSK ?
> Any help will be greatly appreciated
> Thanks
> Yours sincerely
> Philippe Guardiola

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sun 27 Jul 2008 - 14:34:47 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 27 Jul 2008 - 19:32:42 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive