Displaying 1 result from an estimated 1 matches for "survival_master2".
2009 Oct 13
1
Time Dependent Cox Model
...time dep. variable is habitat and I have it recorded for every
day (with some NAs). I think it is working properly except for calculating
the death.time. This column should be 1s or 0s and as I have it only
produces 0s. Any help will be greatly appreciated.
http://www.nabble.com/file/p25881478/Survival_master2.csv
Survival_master2.csv
Here is my code:
sum(!is.na(surv[,16:726]))
surv2<-matrix(0,12329,19)
colnames(surv2)<-c('start', 'stop', 'death.time',
names(surv)[1:15],'habitat')
row<-0 # set record counter to 0
for (i in 1:nrow(surv)) { # loop over ind...