therneau / survival

Survival package for R
381 stars 104 forks source link

predict.coxph.penal() gives an error when the model includes strata #253

Open unoichi opened 4 months ago

unoichi commented 4 months ago
ft=coxph(Surv(time, status) ~ age + strata(sex) + frailty(inst, df=4), lung)
predict(ft)

This gives an error message.

Error in newx %*% coef : non-conformable arguments

Also, the following returns a weird result

ft=coxph(Surv(time, status) ~ strata(sex) + frailty(inst, df=4), lung)
predict(ft)
therneau commented 4 months ago

This is a combination I hadn't seen or tested before: prediction + frailty + frailty has a missing value. I've found the issue, now have to figure out a solution. If you add "model=TRUE" to the first call that will fix the issue, for now

unoichi commented 4 months ago

Thank you very much.