Cargando…

Should I use fixed effects or random effects when I have fewer than five levels of a grouping factor in a mixed-effects model?

As linear mixed-effects models (LMMs) have become a widespread tool in ecology, the need to guide the use of such tools is increasingly important. One common guideline is that one needs at least five levels of the grouping variable associated with a random effect. Having so few levels makes the esti...

Descripción completa

Detalles Bibliográficos
Autor principal: Gomes, Dylan G.E.
Formato: Online Artículo Texto
Lenguaje:English
Publicado: PeerJ Inc. 2022
Materias:
Acceso en línea:https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8784019/
https://www.ncbi.nlm.nih.gov/pubmed/35116198
http://dx.doi.org/10.7717/peerj.12794
_version_ 1784638656003178496
author Gomes, Dylan G.E.
author_facet Gomes, Dylan G.E.
author_sort Gomes, Dylan G.E.
collection PubMed
description As linear mixed-effects models (LMMs) have become a widespread tool in ecology, the need to guide the use of such tools is increasingly important. One common guideline is that one needs at least five levels of the grouping variable associated with a random effect. Having so few levels makes the estimation of the variance of random effects terms (such as ecological sites, individuals, or populations) difficult, but it need not muddy one’s ability to estimate fixed effects terms—which are often of primary interest in ecology. Here, I simulate datasets and fit simple models to show that having few random effects levels does not strongly influence the parameter estimates or uncertainty around those estimates for fixed effects terms—at least in the case presented here. Instead, the coverage probability of fixed effects estimates is sample size dependent. LMMs including low-level random effects terms may come at the expense of increased singular fits, but this did not appear to influence coverage probability or RMSE, except in low sample size (N = 30) scenarios. Thus, it may be acceptable to use fewer than five levels of random effects if one is not interested in making inferences about the random effects terms (i.e. when they are ‘nuisance’ parameters used to group non-independent data), but further work is needed to explore alternative scenarios. Given the widespread accessibility of LMMs in ecology and evolution, future simulation studies and further assessments of these statistical methods are necessary to understand the consequences both of violating and of routinely following simple guidelines.
format Online
Article
Text
id pubmed-8784019
institution National Center for Biotechnology Information
language English
publishDate 2022
publisher PeerJ Inc.
record_format MEDLINE/PubMed
spelling pubmed-87840192022-02-02 Should I use fixed effects or random effects when I have fewer than five levels of a grouping factor in a mixed-effects model? Gomes, Dylan G.E. PeerJ Animal Behavior As linear mixed-effects models (LMMs) have become a widespread tool in ecology, the need to guide the use of such tools is increasingly important. One common guideline is that one needs at least five levels of the grouping variable associated with a random effect. Having so few levels makes the estimation of the variance of random effects terms (such as ecological sites, individuals, or populations) difficult, but it need not muddy one’s ability to estimate fixed effects terms—which are often of primary interest in ecology. Here, I simulate datasets and fit simple models to show that having few random effects levels does not strongly influence the parameter estimates or uncertainty around those estimates for fixed effects terms—at least in the case presented here. Instead, the coverage probability of fixed effects estimates is sample size dependent. LMMs including low-level random effects terms may come at the expense of increased singular fits, but this did not appear to influence coverage probability or RMSE, except in low sample size (N = 30) scenarios. Thus, it may be acceptable to use fewer than five levels of random effects if one is not interested in making inferences about the random effects terms (i.e. when they are ‘nuisance’ parameters used to group non-independent data), but further work is needed to explore alternative scenarios. Given the widespread accessibility of LMMs in ecology and evolution, future simulation studies and further assessments of these statistical methods are necessary to understand the consequences both of violating and of routinely following simple guidelines. PeerJ Inc. 2022-01-20 /pmc/articles/PMC8784019/ /pubmed/35116198 http://dx.doi.org/10.7717/peerj.12794 Text en © 2022 Gomes https://creativecommons.org/licenses/by/4.0/This is an open access article distributed under the terms of the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0/) , which permits unrestricted use, distribution, reproduction and adaptation in any medium and for any purpose provided that it is properly attributed. For attribution, the original author(s), title, publication source (PeerJ) and either DOI or URL of the article must be cited.
spellingShingle Animal Behavior
Gomes, Dylan G.E.
Should I use fixed effects or random effects when I have fewer than five levels of a grouping factor in a mixed-effects model?
title Should I use fixed effects or random effects when I have fewer than five levels of a grouping factor in a mixed-effects model?
title_full Should I use fixed effects or random effects when I have fewer than five levels of a grouping factor in a mixed-effects model?
title_fullStr Should I use fixed effects or random effects when I have fewer than five levels of a grouping factor in a mixed-effects model?
title_full_unstemmed Should I use fixed effects or random effects when I have fewer than five levels of a grouping factor in a mixed-effects model?
title_short Should I use fixed effects or random effects when I have fewer than five levels of a grouping factor in a mixed-effects model?
title_sort should i use fixed effects or random effects when i have fewer than five levels of a grouping factor in a mixed-effects model?
topic Animal Behavior
url https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8784019/
https://www.ncbi.nlm.nih.gov/pubmed/35116198
http://dx.doi.org/10.7717/peerj.12794
work_keys_str_mv AT gomesdylange shouldiusefixedeffectsorrandomeffectswhenihavefewerthanfivelevelsofagroupingfactorinamixedeffectsmodel