test for significance of interaction in linear mixed models in nlme in R

后端 未结 3 2061
清歌不尽
清歌不尽 2021-02-05 23:55

I use lme function in the nlme R package to test if levels of factor items has significant interaction with levels of factor conditi

3条回答
  •  清酒与你
    2021-02-06 00:45

    The usual way to test if the interaction is significant is to do a likelihood ratio test (e.g. see discussion on R-Sig-ME).

    To do that you have to also estimate a model without interaction and you'll also have to use method="ML":

    f0 = lme(response ~ 0 + factor(condition) * factor(items),
        random = ~1|subject, method="ML")
    f1 = lme(response ~ 0 + factor(condition) + factor(items),
        random = ~1|subject, method="ML")
    

    You can then compare using anova:

    anova(f0, f1)
    

    Also see this blog post

提交回复
热议问题