0

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!

  • 1
    I think you are looking for this https://stats.stackexchange.com/questions/48671/what-is-restricted-maximum-likelihood-and-when-should-it-be-used – user2974951 May 25 '20 at 12:19
  • Thank you! So it is okay to "mix" the methods? – a.henrietty May 25 '20 at 12:40
  • As the answers in the provided link state, REML is used to get better estimates, while ML is used to compare models. You can compare models using ML, and then select the best one and use REML. – user2974951 May 26 '20 at 05:42

0 Answers0