Home forums Mixed Models specifying correct lmer_alt models

Tagged: 

Viewing 1 reply thread
  • Author
    Posts
    • #241
      statmerkur
      Participant

      Until Rune Haubo pointed out that he cannot see how these models (using the double-bar notation for factorial designs in the way I do in m1) are relevant I was quite sure that they made sense:
      library("lme4")
      m1 <- afex::lmer_alt(angle ~ recipe + (recipe || replicate), cake)

      He instead suggests that one should use

      m2 <- lmer(angle ~ recipe +
                (0 + dummy(recipe, "A") | replicate) +
                (0 + dummy(recipe, "B") | replicate) +
                (0 + dummy(recipe, "C") | replicate), cake)

      or

      m3 <- lmer(angle ~ recipe + (1 | replicate) +
                (0 + dummy(recipe, "A") | replicate) +
                (0 + dummy(recipe, "B") | replicate) +
                (0 + dummy(recipe, "C") | replicate), cake)

      which are different from m1 and equivalent to
      m4 <- afex::lmer_alt(angle ~ recipe + (0 + recipe || replicate), cake)
      and
      m5 <- afex::lmer_alt(angle ~ recipe + (1|replicate) + (0 + recipe || replicate), cake)

      I’m now quite puzzled because AFAICS you and others (but I don’t remember them) use m1 in the afex vignettes and also here.
      What is the correct way to specify a lmer_alt model for categorical independent variables?

    • #244
      statmerkur
      Participant

      EDIT (I don’t know how I can edit or delete my question?!): I realized that this is a broader question that is not directly related to lmer_alt but more so to lmer and mixed models in general. So I decided to post it on CrossValidated.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.