[R-sig-ME] Choice of fixed effects and random effects in glmm

Phillip Alday me @end|ng |rom ph||||p@|d@y@com
Wed Dec 9 11:24:18 CET 2020


Hi  Faith,

if you have a model like

y ~ 1 + x * location

(i.e. fixed-effects only), then this still accounts for
repeated-measurements within the location. The motivation for doing a
mixed model like

y ~ 1 + x + (1+x|location)

is that this reduces the complexity of the fixed effects, especially
when you don't want to interpret the effects of the individual levels of
location. This reduction in complexity means that you have fewer things
in your fixed-effects table, which is nice, but it also means that there
are fewer parameters in the model (because you model the variance across
locations instead of the mean at each location) and so it becomes easier
to fit such models when you have lots of locations. (There are also some
other more subtle differences in terms of partial pooling, but we can
leave those aside for now).

But if you want to interpret the effect of location or particular
locations, e.g. "the effect of x at location A", then that extra
complexity in the fixed-effects table isn't really a problem. In that
case, I would recommend just treating location as  a fixed effect.

My commentary thus far is simplifying a lot of detail -- there are
exceptions to almost all of the rules I'm stating. I don't know enough
about your data, research question and inference goals to be able to
tell if you are one of the exceptions.

Thierry Onkelinx has a nice blog post on when it's okay to have
something as both a fixed and a random effect:

https://www.muscardinus.be/2017/08/fixed-and-random/

The short answer is "only when you have discrete data, not for
categorical nor continuous data", where discrete data are things like
"time samples" which have a numerical structure but are not truly
continuous. Distinct locations are usually simply categorical because
they don't have a numerical structure (though I guess locations
expressed as e.g. latitude or longitude might).

Best,

Phillip

On 09/12/2020 07:06, Ebhodaghe Faith wrote:
> Hi All.
>
> I'm running a Generalised Linear Mixed Model for a study in which I
> repeatedly collected data within each of 14 different locations. My
> predictor variable is 'location' and at same time wish to account for
> repeated measures within locations. Is it okay in this case to select
> 'location' as both fixed effects and random effects?
>
> Thanks in advance for kind response.
>
> Cheers
> Faith
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models



More information about the R-sig-mixed-models mailing list