2

This is my following script:

library(lme4)
library(RColorBrewer) # needed for some extra colors in one of the graphs
library(lmerTest)# to get p-value estimations that are not part of the standard lme4 packages
lear<-read.csv("C:/Users/Liat/Documents/R/liat_data.csv")
colnames(lear) = c("participant","examiner", "date", "sex", "age", "age_group", "Hearing_status", "compression", "first 5", "last 5", "learning")
names(lear)

model <- lme4::lmer( learning ~ sex+age+Hearing_status,data = lear)
summary(model)

I get the following error: Error: No random effects terms specified in formula

what should I do?

ah bon
  • 9,293
  • 12
  • 65
  • 148

1 Answers1

2

Depending on what variable you want to specify as your grouping variable, you need to add in a | to your equation. For example, if you wanted to group your participants by do the following model<- lme4::lmer(learning~ sex+(sex | <id variable>)+age+Hearing_status, data=lear)

Check out the documentationlme4 cran documentation

Joe Razo
  • 34
  • 3