I'm evaluating competing risks of mortality of birds due to various causes (snakes, mammals, hawks, other) with staggered entry. I have 120 individuals; 60 entered at time 0 and 60 at time 63; I ran survcheck in the R survival package. The transitions appear correct. Has anyone experienced this? Is it a function of the staggered entry? How can it be fixed?
This appear correct
`Call: survcheck(formula = Surv(start, stop, Mortfac) ~ 1, data = mymerge2, id = Band, timefix = T)
Unique identifiers Observations Transitions 120 16314 41
Transitions table: to from Avian Mammalian Other Snake (censored) (s0) 18 12 2 9 79 Avian 0 0 0 0 0 Mammalian 0 0 0 0 0 Other 0 0 0 0 0 Snake 0 0 0 0 0
Number of subjects with 0, 1, ... transitions to each state: count state 0 1 Avian 102 18 Mammalian 108 12 Other 118 2 Snake 111 9 (any) 79 41`
I have no flags when calling the survfit object. However, when running the model receive the Warning:
"Warning message: In cbind(Y[-(1 + e2), 1], Y[-e2, -1]) : number of rows of result is not a multiple of vector length (arg 1)"
When reviewing the output, the number at risk is negative at the first event and probabilities are incorrect.
`Call: survfit(formula = Surv(start, stop, Mortfac) ~ 1, data = mymerge2, id = Band)
time n.risk n.event Pr((s0)) Pr(Avian) Pr(Mammalian) Pr(Other) Pr(Snake) 6 -19 1 1.000 0.00 1.00 0.00000 0.0000 14 -14 1 1.000 1.00 1.00 0.00000 0.0000 25 -9 1 1.000 2.00 1.00 0.00000 0.0000 69 5 1 0.800 2.20 1.00 0.00000 0.0000 73 16 1 0.750 2.20 1.00 0.00000 0.0500 76 18 1 0.708 2.24 1.00 0.00000 0.0500`
Doubled number at risk, now
`Call: survfit(formula = Surv(start, stop, Mortfac) ~ 1, data = mymerge2, id = Band)
n nevent rmean*
(s0) 240 0 129.0403379 Avian 240 18 374.5939873 Mammalian 240 12 195.7509905 Other 240 2 0.4003824 Snake 240 9 7.2143019 *restricted mean time in state (max time = 188 )`
I've edited inputs for id to change from numeric to factor, and various other simple inputs changes. No difference. When running as a simple KM or Cox model where event is dead or alive, the numbers at risk and number of events over time are correct.
I've also tried cumulative incidence functions which do not appear to give correct numbers. If the number at risk is 120 and 18 were killed by avian, then I would expect the values on the Y axis to be much larger than the following. Cuminc doesn't allow for ID variable, which may be the issue for that.