Displaying 1 result from an estimated 1 matches for "modsf1".
Did you mean:
modsf2
2013 Jun 25
1
censor=FALSE and id options in survfit.coxph
...ival)
mod <- coxph(Surv(z, y, e)~x, data=dat)
summary(mod)
# create prediction dataset with 3 individuals with
# x = 0 on (0,2)
# x = 1 on (0,2)
# x = 0 on (0,1) and x = 1 on (1,2)
datnew <- data.frame(x=c(0,1,0,1), z=c(0,0,0,1), y=c(2,2,1,2), e=rep(0,4), id=c(1,2,3,3))
datnew
# as expected
modsf1 <- survfit(mod, newdata=datnew, id=id)
modsf1
# not as expected
modsf2 <- survfit(mod, newdata=datnew, id=id, censor=FALSE)
modsf2
# for comparison
modsf3 <- survfit(mod, newdata=datnew[1:2,])
modsf3
# appears to work when individual=FALSE (id not specified)
modsf4 <- survfit(mod, n...