I am working on a survival analysis in R using the survival
package (and trying to switch it to a Bayesian analysis but that may be a different question). Either way, I'd eventually like to incorporate time-varying covariates, so I'm trying to set the data up as a counting process. But, I'm getting a little lost in "time".
I have a set of wildlife telemetry data where we relocated individuals approximately once per month, though the day of the month varies. I've seen examples in the literature where a monthly relocation schedule means they are alive on the first, and stay alive through the month, and if they die that month, it is assigned to the last day of the month. So, I have my start and stop times set up according to months. For example:
id enter exit event year
<dbl> <dbl> <dbl> <dbl> <dbl>
1 1 2 9 0 2012
2 1 0 8 0 2013
3 1 11 12 0 2013
4 1 0 1 0 2014
5 2 2 7 0 2012
6 3 2 9 0 2012
7 3 0 12 0 2013
where 11=November, 12=December, etc., and the first row indicates we relocated that animal ever month starting in March, but then lost it for a few months after hearing it in September.
The timescale is also set up to be recurrent, so I've split individuals into rows according to year.
Just as a starting point, I ran a Cox PH model on these data:
fit_1 <- coxph(Surv(enter, exit, event) ~ 1, data=dat)
And the survival estimates by the end of the year are much lower than published estimates. So, I'm wondering if my data aren't set up correctly.
In the survival
vignette for the counting process, the start and stop times are in days.
subject time1 time2 death creatinine
1 5 0 90 0 0.9
2 5 90 120 0 1.5
3 5 120 185 1 1.2
So, my questions are:
- Does it matter that I've set my data up according to months? Or do I need to somehow put these times into days? (E.g., should the first row have enter=60 and exit=274 to account for those months in days? But that seems wrong since we only relocated the animal for 1 day during a month.)
- Am I getting low survival estimates because I'm using the counting process format without time-varying covariates? I've run the same dataset through
survfit(Surv(exit, event) ~ 1, dat=dat)
andcoxph(Surv(exit, event) ~ 1, data=dat)
, which give similar results to each other, but are different than what is produced fromSurv(enter, exit, event)
.