Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require(survival)
- D = rbinom(100, 1, 0.5)
- Y = rbinom(100, 1, 0.5)
- X = rexp(100, 1)
- Delta = rbinom(100, 1, 0.5)
- coxph(Surv(time = X, event = Delta) ~ D + offset(Y) + offset(D:Y))
- > coxph(Surv(time = X, event = Delta) ~ D + offset(Y) + offset(I(D*Y)))
- Call:
- coxph(formula = Surv(time = X, event = Delta) ~ D + offset(Y) +
- offset(I(D * Y)))
- coef exp(coef) se(coef) z p
- D -0.9959 0.3694 0.2825 -3.525 0.000423
- Likelihood ratio test=12.26 on 1 df, p=0.0004635
- n= 100, number of events= 53
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement