goranbrostrom / eha

eha
6 stars 1 forks source link

Checking Model Assumptions #11

Open w1806291 opened 3 years ago

w1806291 commented 3 years ago

fert2 <- fert[fert$parity == 2, ] fit <- coxreg(Surv(next.ivl, event) ~ ses + age + year + parish, data = fert2) prop.full <- cox.zph(fit)

Error in cox.zph(fit) : unexpected assign component

goranbrostrom commented 3 years ago

Dear Wahid,

cox.zph is a function from the survival package, so to get what you want, try

fit <- survival::coxph(....) prop.full <- survival::cox.zph(fit)

and you should be fine.

Best, Göran

w1806291 commented 3 years ago

I have loaded the survival and eha packages.

I don't have a problem with coxph, just cox.zph

the error message is...

Error in cox.zph(fit) : unexpected assign component

goranbrostrom commented 3 years ago

On 2021-06-30 16:06, w1806291 wrote:

I have loaded the survival and eha packages.

I don't have a problem with coxph, just cox.zph

the error message is...

Error in cox.zph(fit) : unexpected assign component

Still after my suggestion, i.e.

fit <- coxph(...) cox.zph(fit)

?

Then you should ask the maintainer of 'survival', not me.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/goranbrostrom/eha/issues/11#issuecomment-871435888, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB7LHZ2GCRULAD6M57IMYF3TVMQFNANCNFSM47SATU4Q.

w1806291 commented 3 years ago

ok i'll try that thanks

BTW is there any way of getting all the R code from the book already inputted into R?