I would like to obtain p-values from my model fit with lmer()
from the lme4
package.
It looks something like this:
model4<- lmer(rt~ a + b + c + a*b*c + (1|id), data= dat, REML= FALSE)
I compared the model to less complex models with an LRT-Test via anova()
and thus set REML=FALSE
.
Now, I would like to analyse contrasts in my model model4
and obtain p values.
I read about the package lmerTest
and thought about using satterthwaite method:
library(lmerTest)
fit<- as(model4, "merModLmerTest")
anova(fit)
R gives me an output which looks good.
however, I read that my model needs to be fit by REML=TRUE
.
Did I fit my model wrong, then?
And why do I need to fit REML=TRUE
?
I am confused and would be glad if somebody helped me out! Thanks a lot in advance!