easystats / easystats/performance

Normality of random effect not returned when using `||`

Open
#845 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug :bug:
Dominant language
R
Stars
1.2k
Forks
109
Avg merge
6h 34m
Merged PRs (30d)
8

Description

fm1 <- lme4::lmer(Reaction ~ Days + (Days|Subject), data=lme4::sleepstudy)
performance::check_model(fm1)
Image

Same "model" but with (Days||Subject):

fm2 <- lme4::lmer(Reaction ~ Days + (Days||Subject), data=lme4::sleepstudy)
performance::check_model(fm2)
Image

This isn't an issue of multiple random grouping vars, seems unique to ||:

egsingle <- data.frame(
  schoolid = factor(rep(c("2020", "2820"), times = c(18, 6))),
  lowinc = rep(c(TRUE, FALSE), times = c(18, 6)),
  childid = factor(rep(
    c("288643371", "292020281", "292020361", "295341521"),
    each = 6
  )),
  female = rep(c(TRUE, FALSE), each = 12),
  year = rep(1:6, times = 4),
  math = c(
    -3.068, -1.13, -0.921, 0.463, 0.021, 2.035,
    -2.732, -2.097, -0.988, 0.227, 0.403, 1.623,
    -2.732, -1.898, -0.921, 0.587, 1.578, 2.3,
    -2.288, -2.162, -1.631, -1.555, -0.725, 0.097
  )
)

fm3 <- lme4::lmer(
  math ~ year + (year | childid) + (year | schoolid),
  data = egsingle
)
performance::check_model(fm3)
Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report by running the two lme4::lmer examples and performance::check_model calls, then compare the random-effect normality output for (Days|Subject) and (Days||Subject). Also run the supplied fm3 example to check whether multiple grouping variables behave differently. Done means check_model returns the random-effect normality result for the || model without changing the existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.