[R-sig-ME] Removing random correlation parameter for categorical variable in lmer

Douglas Bates bates at stat.wisc.edu
Fri Jan 15 18:02:24 CET 2016


For a numeric covariate x, the model expression 0 + x produces a model
matrix with a single column so you can suppress the correlation by using
terms like (1 | subject) + (0 + x | subject).  However, for a categorical
covariate like relatedness with 2 levels the expressions (g | subject), (1
+ g | subect) and (0 + g | subject) are equivalent in terms of the
predictions from the fitted model.  The only difference between the last
two is in the "contrasts" that they generate.

If you really want independent random effects for intercept and for the
effect of relatedness you should convert the relatedness factor to a
numeric covariate.  One possibility is (1 | subject) + (0 +
I(as.integer(relatedness) - 1) | subject).

The fact the the first model you fit (with the correlation) is degenerate
is indeed a warning that you are overfitting the data.  I would try to do
some graphical exploration of the data, or perhaps of the residuals from
fitting a model like

Response_time ~ relatedness + mean_response_time +  (1|subject) +
(1|word) + (1|group)

before trying to incorporate exotic random slopes.

On Fri, Jan 15, 2016 at 7:56 AM Spätgens, Tessa <T.M.Spatgens at uva.nl> wrote:

> Dear all,
>
> I am still learning how to use mixed effects models and ran into a problem
> I cannot seem to solve using the advice I can find in articles and on
> various platforms, so I am hoping someone on the list can help me out!
>
> For a study involving a semantic priming experiment, I want to extract the
> random slope terms as a measure of semantic priming, using lmer. The
> related and unrelated items are coded 0 and 1, respectively. I want to
> extract the individual random slope terms for the unrelated items, as a
> deviation from the related items (intercept). However, the model shows a
> perfect correlation between the random intercepts and slopes. I have read
> that this means that the model is overspecified and that, if removing the
> random effects altogether is not an option, you can try to remove the
> correlation parameter itself. However, trying to do this using the formula
> (0+x|y) still yields a correlation parameter for the subjects with variance
> 0. The formula looks like this:
>
>
> Response_time ~ relatedness +  mean_response_time + (0 + relatedness |
> subject) + (1 | word) + (1 | group)
>
> I think this has to do with the fact that it is a categorical variable, as
> trying it with a (different) continuous variable does work. Is there any
> way to remove the correlation parameter in this situation?
>
> Thanks in advance for any advice!
>
> Tessa
>
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>

	[[alternative HTML version deleted]]



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