[R-sig-ME] Modeling and Interpretation Question for Interaction in LMER Output.

Ades, James j@de@ @end|ng |rom he@|th@uc@d@edu
Thu Jun 11 04:09:30 CEST 2020


This is both a question on modeling and output interpretation.

I'm looking at growth in a working memory precision task with five separate conditions. I've used the chi-sq test to develop this final model--with the five separate conditions + an interaction between time and grade. The Lmer model is mod.1 <- lmer(level ~ task + t4 * grade + (t4|pid) + (t4|pid:task), na.action = 'na.exclude', control = lmerControl(optimizer = "nloptwrap", calc.derivs = FALSE), REML = FALSE, filter.dataset.rw)

The hypothesis is that precision provides a better indication of working memory capacity than merely counting items that one can remember.

First, I want to make sure that I am interpreting the lmer output correctly. (In the MRE you can see the output; with an emphasis on minimal, I've only included two of the conditions...I did however, have to include enough participants so that the model wouldn't be "rank deficient"). I changed grade to character because the study was two-year longitudinal (with 4 timepoints), so there are three cohorts (3rd grade becomes the 4th grade, 5th grade becomes the 6th grade, and 7th grade becomes the eighth grade). For the interactions--t4:grade5 and t4:grade6, for instance--would be asking whether the difference between the change in time between grade5 and grade3 is significant and whether the change in grade6 and grade3 is significant for all tasks. Is that correct? Then, since the question I'm really asking is whether there is a significant difference between grade5 and grade6, I'd need to use a package like emmeans to do a pairwise comparison (between 3/4, 5/6, 7/8). Is that correct?

The modeling question regards my depiction of time. The amount of elapsed time between participants and testing points is not equal equal. Students in the same classroom will be measured at equal timepoints, but while one class might have 4 months in between testing, another class might have 7 months. So the way I accounted for this difference was to make the date of everyone's first testing point "1" and then allow that to be a continuous measure for their second, third, and fourth timepoints. My question is whether this is the best way of accounting for the discrepancies in time between participants and testing points and whether I've modeled this in a way that will yield the most information. For instance, while I'd really want to see the difference in performance between all four timepoints for the 3rd, 5th, and 7th grade cohorts; with my current model, I can only see the difference between performance in grades 3/4, 5/6, 7/8. Is there a way, specifically, that I could have categorical output of the four timepoints, accounting for the discepancies in time among the four testing points? Or would it work to model the four timepoints as a fixed effect (just 1,2,3,4), but then to model the random slope of time?

Thanks much!

James



```

filter.dataset.rw <-

structure(list(pid = c("ADMIN-UCSF-bo004", "ADMIN-UCSF-bo008",
"ADMIN-UCSF-br045", "ADMIN-UCSF-ca133", "ADMIN-UCSF-cp042", "ADMIN-UCSF-la074",
"ADMIN-UCSF-pe167", "ADMIN-UCSF-pe300", "ADMIN-UCSF-bo004", "ADMIN-UCSF-bo008",
"ADMIN-UCSF-br045", "ADMIN-UCSF-ca133", "ADMIN-UCSF-cp042", "ADMIN-UCSF-la074",
"ADMIN-UCSF-bo008", "ADMIN-UCSF-br045", "ADMIN-UCSF-ca133", "ADMIN-UCSF-cp042",
"ADMIN-UCSF-la074", "ADMIN-UCSF-pe167", "ADMIN-UCSF-bo004", "ADMIN-UCSF-bo008",
"ADMIN-UCSF-br045", "ADMIN-UCSF-ca133", "ADMIN-UCSF-la074", "ADMIN-UCSF-pe167",
"ADMIN-UCSF-pe300", "ADMIN-UCSF-bo004", "ADMIN-UCSF-bo008", "ADMIN-UCSF-br045",
"ADMIN-UCSF-ca133", "ADMIN-UCSF-cp042", "ADMIN-UCSF-la074", "ADMIN-UCSF-pe167",
"ADMIN-UCSF-pe300", "ADMIN-UCSF-bo004", "ADMIN-UCSF-bo008", "ADMIN-UCSF-br045",
"ADMIN-UCSF-ca133", "ADMIN-UCSF-cp042", "ADMIN-UCSF-la074", "ADMIN-UCSF-bo008",
"ADMIN-UCSF-br045", "ADMIN-UCSF-ca133", "ADMIN-UCSF-cp042", "ADMIN-UCSF-la074",
"ADMIN-UCSF-pe167", "ADMIN-UCSF-bo004", "ADMIN-UCSF-bo008", "ADMIN-UCSF-br045",
"ADMIN-UCSF-ca133", "ADMIN-UCSF-la074", "ADMIN-UCSF-pe167", "ADMIN-UCSF-pe300"
), task = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L,
5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L), .Label = c("R2B0",
"R2B2", "R2B4", "R4B0", "R4B2"), class = "factor"), grade = c("3",
"3", "5", "7", "3", "5", "7", "7", "3", "3", "5", "7", "3", "5",
"4", "6", "8", "4", "6", "8", "4", "4", "6", "8", "6", "8", "8",
"3", "3", "5", "7", "3", "5", "7", "7", "3", "3", "5", "7", "3",
"5", "4", "6", "8", "4", "6", "8", "4", "4", "6", "8", "6", "8",
"8"), level = c(-0.13232044198895, -0.0489871086556202, -0.13232044198895,
-0.13232044198895, 0.03434622467772, 0.03434622467772, -0.0489871086556202,
-0.13232044198895, -0.13232044198895, -0.13232044198895, 0.11767955801105,
0.03434622467772, -0.0489871086556202, 0.03434622467772, 0.03434622467772,
-0.13232044198895, -0.0489871086556202, -0.13232044198895, 0.20101289134438,
-0.0489871086556202, -0.0489871086556202, -0.0489871086556202,
0.03434622467772, -0.13232044198895, 0.03434622467772, -0.13232044198895,
0.20101289134438, -0.167127071823204, -0.000460405156534227,
-0.0837937384898744, -0.167127071823204, -0.167127071823204,
-0.167127071823204, 0.0828729281767957, -0.000460405156534227,
-0.167127071823204, -0.0837937384898744, -0.000460405156534227,
-0.0837937384898744, -0.0837937384898744, 0.416206261510126,
-0.0837937384898744, -0.000460405156534227, -0.0837937384898744,
-0.167127071823204, -0.0837937384898744, -0.000460405156534227,
0.0828729281767957, -0.0837937384898744, -0.000460405156534227,
-0.167127071823204, -0.000460405156534227, 0.332872928176796,
-0.000460405156534227), t4 = c(-10.9112585334942, -10.9112585334942,
-10.9112585334942, -10.9112585334942, -10.9112585334942, -10.9112585334942,
-10.9112585334942, -10.9112585334942, -10.9112585334942, -10.9112585334942,
-10.9112585334942, 3.68357690127109, 3.67897919202246, 3.67897919202246,
3.62695800727158, 3.62695800727158, 4.30543499808373, 4.30296890558854,
4.30789502392459, 4.30789502392459, 4.30543499808373, 4.30543499808373,
4.28804325537186, 4.68764324402763, 4.55866330254692, 4.67580878638063,
4.67580878638063, -10.9112585334942, -10.9112585334942, -10.9112585334942,
-10.9112585334942, -10.9112585334942, -10.9112585334942, -10.9112585334942,
-10.9112585334942, -10.9112585334942, -10.9112585334942, -10.9112585334942,
3.68357690127109, 3.67897919202246, 3.67897919202246, 3.62695800727158,
3.62695800727158, 4.30543499808373, 4.30296890558854, 4.30789502392459,
4.30789502392459, 4.30543499808373, 4.30543499808373, 4.28804325537186,
4.68764324402763, 4.55866330254692, 4.67580878638063, 4.67580878638063
), timepoint = c(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3,
3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 2,
2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4)), row.names = c(NA,
-54L), class = "data.frame")

```


	[[alternative HTML version deleted]]



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