[R-sig-ME] Random effects in multinomial regression in R?
ph||||p@@|d@y @end|ng |rom mp|@n|
Wed Mar 20 18:02:14 CET 2019
Generally speaking for the parameterization of mixed-effects models in
lme4/brms/the usual packages, it doesn't make sense to have a varying
slope (e.g. Time|Subject) without the corresponding fixed effect. This
is because the varying slopes are calculated as offsets from the group
mean, i.e from the fixed effect estimate. Not doing including the fixed
effect is equivalent to assuming the group mean is zero, which is
usually not the assumption you want to make.
If you fit models with random slopes without the corresponding fixed
effects, then there are two main problems:
1. The corresponding variance parameter will be mis-estimated because it
will be the average squared distance to zero and not the average squared
distance to the mean (and average squared distance to the mean is the
definition of variance).
2. The model may not converge because the numerics are set up under the
"zero mean" assumption. For lme4/nlme, this is the case, but I believe
that brms may do some internal reparameterization that may avoid these
difficulties. (And a model fit with MCMC (brms) may not have the same
numerical issues as a model fit with MLE (lme4)).
In brief: just add time as a fixed effect.
Also: why not fit your model as a continuous model with pre vs. post as
a contrast in the model rather reducing a continuous variable to a
category? You can still apply a categorical distinction afterwards if
you so desire, but in my experience, it's best to defer making things
categorical until as late as possible (see also Frank Harrel's comments
on prediction vs. classification:
http://www.fharrell.com/post/classification/). Moreover, it's a lot
easier to fit a continuous model than a multinomial one ....
On 18/3/19 7:11 pm, Souheyla GHEBGHOUB wrote:
> I have *Change* from Pretest to Posttest (gain, no_gain, decline) as the
> DV. Also *Pretest* and *Group* as covariates. This called for a multinomial
> mod0 <- brm(Change ~ Pretest + Group)
> *Question: *I'd like to add random effects of *Subject* and *Word*, which
> may differ by time, but I don't have effect of *Time* to do:
> mod1 <- brm(Change ~ Pretest + Group + (Time|Subject) + (Time|Word))
> So I thought of this:
> mod2 <- brm(Change ~ Pretest + Group + (1|Subject) + (1|Word))
> but this also seems wrong to me. What do you think is the best way to treat
> random effects in this situation, please?
> Thank you
> Souheyla Ghebghoub
> [[alternative HTML version deleted]]
> R-sig-mixed-models using r-project.org mailing list
More information about the R-sig-mixed-models