I am trying to run a multiple comparisons on an anova for a lmer. I am getting the following error:
Error in Ktotal[count:(count + nrow(h$K) - 1), h$where] <- h$K :
number of items to replace is not a multiple of replacement length
The model is the following:
rest1 <- lmer(rest~sex+age+season+month+session+(1|id), data = mydata)
the variable "month" is what I want to compare and it has 6 factors with the following # of observations:
APRIL DEC JAN JUNE MAY NOV
269 579 377 303 355 395
When I run the glht for other variables with only 2 factors like season, which only has wet vs dry, it runs fine, no error. Am I getting this message because of the unbalanced groups of months?