Skip to content
Prev 15362 / 20628 Next

Continuous variable as random slope and the minimum number of levels for a categorical variable to be treated as random

Dear Conor,

Thanks a lot for your answers. I don't know why but I have misunderstood
the article, I've thought it was talking about random slopes. Now it makes
sense.
However I didn't know that even continuous, ordered variables can be used
as grouping factors. Do you have any reference about that? The link I've
shared clearly states it is not possible.
However, in your example you have spoken about age. May be a good idea to
use it as a nested grouping factor in the participant grouping factor? I
mean something like (1|subject:age).

Best regards,

Michele


Il 14 Apr 2017 12:50 PM, "Conor Michael Goold" <conor.goold at nmbu.no> ha
scritto:

Hi,

The post you link to is to treating "random effect" solely as the blocking
factor or hierarchical grouping factor in the model, when one wants to
estimate different intercept parameters for each of the grouping factors.
For instance, when observations are nested within individuals as in the
sleep study, then individuals are the grouping factor or the "random
effect" and will have their own intercept. Actually, in one of the comments
(second one), the author admits he doesn't include the topic of random
slopes for brevity. But even with random slope terms, the slope is varying
with respect to the same blocking factor as the intercept.

However, continuous variables that respect order (e.g. different ages) can
also be treated as random effects or grouping variables through Gaussian
process models.

When you say you have seen GLMMs with only 2 levels, do you mean random
slopes or random intercepts? I'm guessing the former based on your first
question.

The minimum size for a discrete grouping factor is dependent on the exact
context (e.g. how many parameters are being estimated), but many recommend
5 as a minimum (although, this would only stand for the simplest of models)
and more is always better. For instance, Stegmueller 2013 (
http://onlinelibrary.wiley.com/doi/10.1111/ajps.12001/abstract) says that
having at least 15-20 levels of the grouping factor in ML estimation is
best, whereas Bayesian methods are more robust at lower number of levels
per grouping factor.

Also, as another commenter discussed, the random/fixed effect terms can be
confusing and perhaps a better way to think about these sorts of models is
simply whether parameters vary by some grouping factor or not. Thus, you
could have intercepts or slopes varying with respect to a grouping factor.
I prefer to write "Intercepts and the slope of predictor X varied by each
individual" rather than "Random intercepts and slopes were included"
because I think it's ultimately clearer about what is being done and what
readers can expect from the analysis.

Best regards
Conor Goold
PhD Student
Phone:        +47 67 23 27 24



Norwegian University of Life Sciences
Campus ?s. www.nmbu.no