Skip to content

Commit 689a2f7

Browse files
20260410 - supplemental info
1 parent 152c6a8 commit 689a2f7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

hlm.qmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ mydata$ageYearsCenteredSquared <- mydata$ageYearsCentered ^ 2
8787
ageAtT1 <- mydata %>%
8888
ungroup() %>%
8989
filter(timepoint == 1) %>%
90-
mutate(
90+
mutate( # if we had date of birth, we could compute birth cohort (e.g., birth year), if we had time of measurement, we could compute period (e.g., year) at T1
9191
ageAtT1 = ageYears, # use age at baseline (T1) or birth year to reduce bias from attrition-related missing data
9292
ageAtT1Centered = ageAtT1 - min(ageAtT1, na.rm = TRUE),
9393
ageAtT1CenteredSquared = ageAtT1Centered ^ 2) %>%
@@ -714,7 +714,7 @@ print(effectsize::standardize_parameters(
714714

715715
```{r}
716716
acceleratedLongitudinalMixedModel_quadratic <- lmer(
717-
math ~ timeInStudy*sex*ageAtT1Centered + timeInStudySquared*sex*ageAtT1Centered + ageAtT1CenteredSquared + (1 + timeInStudy + timeInStudySquared | id),
717+
math ~ timeInStudy*sex*ageAtT1Centered + timeInStudySquared*sex*ageAtT1Centered + ageAtT1CenteredSquared + (1 + timeInStudy | id),
718718
data = mydata,
719719
REML = FALSE, #for ML
720720
na.action = na.exclude,

0 commit comments

Comments
 (0)