Skip to content

cox model with time-dependent covariates

2 messages · Raphaelle, BXC (Bendix Carstensen)

#
Dear all,

I am planning to run a cox model with time-dependent covariates. I would
like to use the 'fold' function (Fox, 2002:
http://cran.r-project.org/doc/contrib/Fox-Companion/appendix-cox-regression.pdf)
to create the dataset, with one observation per subject & time-window, and
then  use the 'coxph' function of the survival package to run the model.

However, I had a couple of questions, and I can't find the answer on the
internet:

1. In the document writtent by Fox, the new dataset created for the
purpose of the time-dependent covariates model (Rossi.2) numbers the
observations 1.1, 1.2, 1.3, 1.4, 1.5, etc. which corresponds to the
measurements in the different time-windows for subject 1. My question is
the following: if I run a cox model on such a dataset, is the model
accounting for the fact that 1.1, 1.2, 1.3, ... belongs to the same
subject?

2. I will have a big dataset, i.e. 40,000 subjects and 36 time-windows,
i.e. 1,440,000 lines, and about 20 covariates. I was wondering if I should
expect some big troubles to run my analysis, or can the software handle so
many rows?

Many thanks for your help and your time,

Regards,

Raphaelle
#
You do not necessarily have to have one observation per time-window if you use a Cox mode, you just need a new record every time the time-dependent variable changes.

You would presumably get a better feel for you data and an easier access to the analyses if you used the Lexis facilities in the Epi package.
Two papers have recently appeared in Journal of Statistical Software 
http://www.jstatsoft.org/, describing this:

Lexis: An R Class for Epidemiological Studies with Long-Term Follow-Up
Vol. 38, Issue 5, Jan 2011
Authors: Martyn Plummer, Bendix Carstensen

Using Lexis Objects for Multi-State Models in R
Vol. 38, Issue 6, Jan 2011
Authors: Bendix Carstensen, Martyn Plummer
 
Best regrads,
Bendix Carstensen
ox-regression.pdf)