[R] coxph() and survfit()

Mura Tamakou muratamakou at yahoo.com
Fri Oct 23 08:19:29 CEST 2009


Dear All,

I have a question regarding the output of survfit() when I supply a Cox model. Lets say for example:

library(survival)

fit <- coxph(Surv(time, status == 2) ~ factor(spiders), data = pbc)
fit # HR for spiders is significant


newdata <- data.frame(spiders = factor(0:1))
sf <- survfit(fit, newdata = newdata)
sum.sf <- summary(sfit, times = c(2000, 2500, 3000))

# survival estimates for the yes/no spiders
# and the 3 follow up times
sum.sf$surv

# corresponding lower limits of the
# 95% CI
sum.sf$low

# corresponding upper limits of the
# 95% CI
sum.sf$up


we observe that the 95% CIs overlap!! How is this possible since the HR for spiders is significant.

Regards,

Mura




More information about the R-help mailing list