>
>I ran a simple survival analysis for membership in a club using
>
> survfit(Surv(tenure, expired) ~ book.flag, data = x)
>
>for people who did and did not access online books. Expired is a dummy
>if their membership expired (expired = 0). I'd like to calculate the
>odds of surviving 2 years, 3 years, 4 years, and 5 years if they access
>a book vs. not accessing. Can this be done? If so, how? I'd like to
>show that the odds are significantly higher for book accessers - the
>plot already showed this, but I know my client will ask for something
>like the odds.
>
>Thanks,
>
>Walt Paczkowski
>
Walt,
1. The usual approach would be to calcualte the hazard ratio rather than the
odds ratio. This is mostly because the HR is so readily available from fitting
a Cox model. (In the same way that logistic regression is the foundation of
popularity for the odds ratio). As to interpretation, it is fairly easy to
show
that risk ratio <= hazard ratio <= odds ratio; the HR is usually about midway
between them in fact.
fit1 <- coxph(survfit(Surv(tenure, expired) ~ book.flag, data = x)
summary(fit1)
plot(cox.zph(fit1, transform='identity'))
The last looks at the HR as a function of time.
2. Or, you could just read the results off of the survfit output
sfit <- survfit(Surv(tenure, expired) ~ book.flag, data = x)
summary(sfit, times=c(1,2,3,4))
This will give you the survival at times 1,2,3, and 4. The odds ratio will be
(s1 / 1-s1) / (s2 / 1-s2)
where s1 and s2 are the survivals, at some particular time, for the two groups.
Terry T.
|