Skip to content
Prev 32233 / 398506 Next

survit function and cox model with frailty

Hi:

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,
                data=My.data)


Then, I prepare a data frame:


temp <- data.frame(t0=c(0,365,730,1095,1460),
                   t=c(365,730,1095,1460,3000),
                   d=c(0,0,0,0,0),
                   x1=c(0,0,0,0,0),
                   x2=c(1.5,1.5,1.5,1.5,1.5))


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:
Error in model.frame(formula, rownames, variables, varnames, extras,
extranames,  :
        variable lengths differ


Thank you very much,
giacomo