therneau/survival

Using tt() for large (100k) datasets

Closed this issue · 1 comments

jedHK commented

I'd like to add time-varying coefficients to my Cox to account for some PH violations. I'm using sensitive data and work on a remote server, and I am therefore limited to the computational capabilities of the provider.

My dataset has 100k samples and each has one time entry. When I try to use the tt() function in coxph I get the error: "Cannot allocate vector of size...".

Is there a way around this? In my circumstance, time-varying coefficients seem the way to go but this limitation of tt() appears to be fatal (at least if I'm using the survival package). I'm also open to suggestions of other packages for achieving the same goal however I'd rather stay in survival if possible.

In the vignette "Using time dependent Covariate", which contains details on tt(), look for the paragraph that begins "An alternate way to fit the above model is to create the expanded data set directly ..." and the following examples. Pay particular attention to using a coarser time grid.