[R] survit function and cox model with frailty

gc4@duke.edu gc4 at duke.edu
Mon May 19 21:40:00 CEST 2003


I have a question about the use of the survfit function after the
estimation of a cox proportional hazard model with a frailty term. My goal
is to estimate expected survival probabilities while controlling for the
group-specific frailty term.

First, I estimate a model of the following form:

model1 <- coxph(Surv(t0, t, d) ~ x1 + x2 + frailty(id), na.action=na.exclude,

Then, I prepare a data frame:

temp <- data.frame(t0=c(0,365,730,1095,1460),

I think I would need to enter a statement with respect to the frailty
term, but I don't know how.

Indeed, when I use the survit function with temp data frame, I get an
error message:

> fit2 <- survfit(model1, newdata=temp, individual=TRUE)
Error in model.frame(formula, rownames, variables, varnames, extras,
extranames,  :
        variable lengths differ

Thank you very much,

More information about the R-help mailing list