Skip to content

Commit e03dca3

Browse files
20250804 - timepoint-specific errors
1 parent cc9c826 commit e03dca3

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

hlm.Rmd

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,21 @@ icc(linearMixedModel)
216216
icc(linearMixedModel_nlme)
217217
```
218218

219+
### Growth Curve Model with Timepoint-Specific Errors {#timepointSpecificErrorsGCM}
220+
221+
Adapted from Usami & Murayama (2018):
222+
223+
```{r}
224+
timepointSpecificErrorsMixedModel <- lmer(
225+
math ~ female + ageYearsCentered + female:ageYearsCentered + (1 | id) + (1 | ageYearsCentered), # timepoint-specific errors: observations are cross-classified with person and timepoint; sex as a fixed-effect predictor of the intercepts and slopes
226+
data = mydata,
227+
REML = FALSE, #for ML
228+
na.action = na.exclude,
229+
control = lmerControl(optimizer = "bobyqa"))
230+
231+
summary(timepointSpecificErrorsMixedModel)
232+
```
233+
219234
### Quadratic Growth Curve Model {#quadraticGCM}
220235

221236
When using higher-order polynomials, we could specify contrast codes for time to reduce multicollinearity between the linear and quadratic growth factors: https://tdjorgensen.github.io/SEM-in-Ed-compendium/ch27.html#saturated-growth-model

0 commit comments

Comments
 (0)