[R-sig-ME] Meaning of Corr of random-effects with a cross-level interaction

Thierry Onkelinx th|erry@onke||nx @end|ng |rom |nbo@be
Fri Sep 25 10:03:31 CEST 2020

Dear Simon,

A perfect correlation between random effect parameters indicates a problem.
Note the failed convergence warning.
Standardising ses makes things even worse: it yields a singular fit error.

Removing the random slope of ses or the sector interaction solves the
problem. i.e. the model runs and yields sensible output.

Looking at the data, it seems like both math and ses have bounds. Ses
even seems to have some data above its upper bound.
The model assumes no bounds in the response variable. Maybe this is the
cause of the problem.

ggplot(hsb, aes(x = ses, y = math, colour = factor(sector))) +

Best regards,


ir. Thierry Onkelinx
Statisticus / Statistician

Vlaamse Overheid / Government of Flanders
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
thierry.onkelinx using inbo.be
Havenlaan 88 bus 73, 1000 Brussel

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to say
what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey


Op do 24 sep. 2020 om 18:39 schreef Simon Harmel <sim.harmel using gmail.com>:

> Dear All,
> I had a quick question. I have a cross-level interaction in my model below
> (ses*sector). My cluster-level predictor "sector" is a binary variable
> (0=Public, 1=Private). My level-1 predictor is numeric.
> QUESTION:  The `Corr = 1` is indicating the correlation between
> intercepts and slopes across BOTH public & private sectors (like their
> average) OR something else?
> hsb <- read.csv('
> https://raw.githubusercontent.com/rnorouzian/e/master/hsb.csv')
> summary(lmer(math ~ ses*sector + (ses|sch.id), data = hsb))
> Random effects:
>  Groups   Name        Variance Std.Dev.     Corr
>  sch.id   (Intercept)  3.82107    1.9548
>           ses                0.07587     0.2754        1.00
>  Residual             36.78760 6.0653
>         [[alternative HTML version deleted]]
> _______________________________________________
> R-sig-mixed-models using 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