[R] Surv(): Stop time must be > start time, NA created
Federico Calboli
f.calboli at imperial.ac.uk
Fri Jun 3 12:17:05 CEST 2011
I am writing to get a better handle on a warning I am getting from a coxph analysis I am doing.
I am analysing age of onset of dementia *after* the onset of parkinson disease. My data looks like:
age.park age.dem age.death censor x1 x2 x3 x4
1 76 87 88 0 16 33 E3 E3
2 75 84 84 0 33 36 E3 E3
3 77 81 81 1 NA NA <NA> <NA>
4 65 65 69 0 NA NA E4 E4
5 56 76 79 0 NA NA <NA> <NA>
6 62 72 72 1 NA NA <NA> <NA>
...
Obviously some individuals (lines 1,2,5) will first develop parkinson, then a few years later, dementia. Some individuals will not develop dementia (lines 3 and 6, where age of death and age of dementia correspond, but the censor variable is 1). Some (more) unluky individuals develop parkinson and dementia at the same time (line 4).
my coxph model looks like
coxph(Surv(age.mot,age.dem, censor) ~ x1 + x2 + x3 + x4, mydata)
and I get the warning:
In Surv(age.mot, age.dem, censor) :
Stop time must be > start time, NA created
I am almost sure that this is due to the instances where age.park == age.dem, but there is nothing I can really do. So my question:
how do I deal with the instances where age.park == age.dem in order to keep those individuals in the analysis and to get sensible results?
Best wishes
Federico
--
Federico C. F. Calboli
Department of Epidemiology and Biostatistics
Imperial College, St. Mary's Campus
Norfolk Place, London W2 1PG
Tel +44 (0)20 75941602 Fax +44 (0)20 75943193
f.calboli [.a.t] imperial.ac.uk
f.calboli [.a.t] gmail.com
More information about the R-help
mailing list