R: error from Zelig's coxph

350 views Asked by At

I'm getting an error from the Cox's survival model provided in Zelig.

Here's an example using dummy data:

require(survival)
require(Zelig)
dat <- data.frame(survival = rnorm(1000, 100, 20), event = c(rep(1, 200), rep(0, 800)), ind = sample(rep(c("A","B","C"), 1000 * c(0.3, 0.3, 0.4)), 1000))
zelig(Surv(survival, event) ~ ind, model = "coxph", data = dat)

This gives the error:

Error in eval(expr, envir, enclos) : attempt to apply non-function

This also happens with my real data.

Can anyone see what I'm doing wrong?

0

There are 0 answers