Home forums Mixed Models Trouble with ordered contrasts and lmer_alt

This topic contains 2 replies, has 2 voices, and was last updated by  David Sidhu 11 months, 1 week ago.

  • Author
  • #327

    David Sidhu

    I’m using the MASS package to create ordered contrasts (i.e., compare level 3 to level 2; level 2 to level 1). However, I am running into an error when I try to use lmer_alt() and uncorrelated random effects with this coding. Do you have any idea why this might be? I’m attaching a reproducible example below.

    Subj <- rep(1:10, each = 10)
    Item <- rep(1:10, times = 10)
    IV1 <- rep(1:5, times = 20)
    DV <- rnorm(100)
    data <- as.data.table(cbind(Subj, Item, IV1, DV))
    data$Subj <- as.factor(data$Subj)
    data$Item <- as.factor(data$Item)
    data$IV1 <- as.factor(data$IV1)
    contrasts(data$IV1) <- contr.sdif(5)
    mafex <- lmer_alt(DV ~ IV1 + (1 + IV1||Subj) + (1|Item), data = data)

    I get the following error:

    Error in terms.formula(frml) : invalid model formula in ExtractVars

  • #328


    Thanks for the bug report. I have fixed this in the development version on github, which you can get via:

    It might take some time until it gets on CRAN as there are some things I still want to fix before that.

  • #329

    David Sidhu

    Thanks very much!

You must be logged in to reply to this topic.