georgheinze / coxphf

2 stars 0 forks source link

terms() is not defined #7

Closed wiedenhoeft closed 1 year ago

wiedenhoeft commented 2 years ago

A fitted model claims to be of class coxph, yet using terms(fit), which is defined for objects of class coxph, results in Error in terms.default(fit) : no terms component nor attribute. This, among other things, impedes using survminer::ggadjustedcurves to control for covariates (side note: would this approach actually be valid for Firth's penalization?). Thanks in advance :-)

gregorsteiner commented 1 year ago

Hi, thanks fo raising this issue! The fitted model is its own class coxphf which inherits some features from coxph. In #9, I added terms to the returned object, so terms(fit) should work now.