easystats / modelbased

:chart_with_upwards_trend: Estimate effects, contrasts and means based on statistical models
https://easystats.github.io/modelbased/
GNU General Public License v3.0
234 stars 19 forks source link

between_within or ml1 df for post-hoc tests based on glmm #222

Open InkaMarei opened 1 year ago

InkaMarei commented 1 year ago

I have a question regarding the degrees of freedoms used in post-hoc tests in modelbased. The parameters package allows the selection of "betwithin" or "ml1" degrees of freedoms for GLMMs which seems the better choice than the residual degrees of freedoms or z-tests. However, I cannot find out how I can use those in subsequent post-hoc testing via modelbased (or emmeans). Is that even possible? I would really value your response.

bwiernik commented 1 year ago

I would recommend using profile or uniroot confidence intervals (eg, ci_method = "profile") rather than any DoF approximation. This is a much stronger theoretical foundation. If you really insist on a DoF approximation, they each have really important pros and cons and which is the best one to use will really depend on your model and data.

strengejacke commented 1 year ago

I'm not sure you have this option for post-hoc tests. I think you can indeed "only" specify df's (but not 100% sure, though).

InkaMarei commented 1 year ago

Hello, thank you very much for your responses! Maybe I understand something incorrectly, but even with profile-likelihood estimation (allows estimation of unsymmetric CIs of the final estimate), I still have the issue of increased type 1 error when I use residual dfs, or am I mistaken? Anyhow, the profile-likelihood option can to my knowledge also only be selected in the parameters package, and not in modelbased for post-hoc testing or in emmeans, right? From my perspective, this problem with not being able to use an appropriate number of dfs in post-hoc testing after a GLMM is a major drawback of emmeans and modelbased. I am using R for regulatory purposes and am dependent on a proper estimation of dfs after GLMMs. Using GLMMs and following post-hoc tests is recommended in the new EFSA bird and mammal Guidance (https://efsa.onlinelibrary.wiley.com/doi/epdf/10.2903/j.efsa.2023.7790), and the EFSA draft honey bee Guidance (https://www.efsa.europa.eu/en/news/bees-and-pesticides-draft-guidance-update-public-consultation). Not being able to estimate the dfs for post-hoc testing after GLMMs is restriciting us to use R in regulatory ecotoxicology. Is it possible to add this feature and maybe even think about implementing Kenward-Rogers df and satterthwaites dfs for GLMMs? It is possible in SAS (https://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_glimmix_details40.htm) and it would be extremely helpful in R!

A possible solution would be that I could use the output from model_parameters(), along with the dfs from the ml1 method, in modelbased.