Skip to content

Commit

Permalink
20250218 - make random intercepts explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
isaactpetersen committed Feb 18, 2025
1 parent 5694f3f commit 81e4c84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hlm.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ ggplot(

```{r}
linearMixedModel <- lmer(
math ~ female + ageYearsCentered + (ageYearsCentered | id),
math ~ female + ageYearsCentered + (1 + ageYearsCentered | id),
data = mydata,
REML = FALSE, #for ML
na.action = na.exclude,
Expand All @@ -141,7 +141,7 @@ newData$sex[which(newData$female == 0)] <- "male"
newData$sex[which(newData$female == 1)] <- "female"
newData$sex <- as.factor(newData$sex)
newData$predictedValue <- predict(
newData$predictedValue <- predict( # predict.merMod
linearMixedModel,
newdata = newData,
re.form = NA
Expand Down

0 comments on commit 81e4c84

Please sign in to comment.