[R-sig-ME] Why lme4 doesn't throw an error for illegitimate an model

Simon Harmel @|m@h@rme| @end|ng |rom gm@||@com
Wed Oct 7 21:30:58 CEST 2020


correction:

As far as I understand, in a 2-level model, the use of a level-2 predictor
(here "sector") in the ***random part*** is illegitimate.

But I wonder why in the following model `lmer` doesn't throw an error to
indicate that? What does the random part estimates in the output?

library(lme4)
hsb <- read.csv('
https://raw.githubusercontent.com/rnorouzian/e/master/hsb.csv')

mn <- lmer(math ~ ses + (sector | sch.id), data = hsb)



On Wed, Oct 7, 2020 at 2:24 PM Simon Harmel <sim.harmel using gmail.com> wrote:

> Dear All,
>
> As far as I understand, in a 2-level model, the use of a level-2 predictor
> (here "sector") is illegitimate.
>
> But I wonder why in the following model `lmer` doesn't throw an error to
> indicate that?
>
> library(lme4)
> hsb <- read.csv('
> https://raw.githubusercontent.com/rnorouzian/e/master/hsb.csv')
>
> mn <- lmer(math ~ ses + (sector | sch.id), data = hsb)
>

	[[alternative HTML version deleted]]



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