harrelfe / rms

Regression Modeling Strategies
https://hbiostat.org/R/rms
Other
177 stars 49 forks source link

Type of anova, add type information to object returned by `anova.rms`? #105

Closed krassowski closed 3 years ago

krassowski commented 3 years ago

Thanks for the amazing package @harrelfe! I wonder what type of ANOVA does anova.rms return? I believe there is no mention of this in the documentation, but a 3 years old comment in https://github.com/harrelfe/rms/issues/60#issuecomment-373434171 and my experiments in https://github.com/easystats/parameters/issues/577#issuecomment-894470077 suggest that this is type 2. After having a brief look at the source code however I am sill not confident whether the type 2 is used for all the various types of models that can be passed to anova.rms (e.g. rms::orm). Could you please clarify that?

Further I noticed that parameters::parameters returns incorrect type at least for rms::ols; as explained by one of the maintainers in https://github.com/easystats/parameters/issues/577#issuecomment-894753133 they cannot fix this cleanly because the class returned by anova.rms is the same as the one returned by base anova, and there is no type information in the object. If you confirm that it uses type 2 for all objects, I am happy to make a pull request if you would like me to do so.

harrelfe commented 3 years ago

anova.rms computes only type II tests (partial tests that are order-independent). So type is not relevant.