easystats / easystats/performance
Normality of random effect not returned when using `||`
Open
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)
Same "model" but with (Days||Subject):
fm2 <- lme4::lmer(Reaction ~ Days + (Days||Subject), data=lme4::sleepstudy)
performance::check_model(fm2)
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)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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