Mixed Models – Assumptions for LMER Models

lme4-nlmemixed modelrrandom-effects-modelrepeated measures

subject <- factor(rep(c(1,2,3,4,5,6,7),each=4, times=2))
dep <- c(5,4,9,3,4,4,2,1,10,7,8,7,1,2,1,1,5,10,1,7,3,2,1,4,3,8,7,3,1,1,2,1,15,10,20,11,2,2,1,3,11,12,9,7,2,3,1,2,11,9,8,9,3,4,2,1) 

f1 <- factor(rep(c(rep("Female",times=16),rep("Male",times=12)), times=2))
f2 <- factor(rep(c("day1","day2","day3","day4"),times=14))

data <- data.frame(sub=subject, dep=dep, f1=f1, f2=f2)

m <- lmer(dep ~ f1*f2 + (1|sub), data=data)

I'm trying to understand how I can test the assumptions for mixed models.

1) In the case of model m, should I look at homogeneity of variances for every combination of f1 and f2 like this plot(resid(m)~fitted(.)|f1:f2) or is it enough to simply do plot(resid(m))?

2) In either case my real model is showing a funnel shape, is this too problematic? What would you do in that case?

3) How can I check the linearity assumption for each categorical variable in R?

4) Apart from homogeneity of variances and normality of residuals, are there any other important assumptions that you think I should be aware of?

Best Answer

  1. Existence of variance: Do not need to check, in practice, it is always true.

  2. Linearity: Do not need to check, because your covariates are categorical.

  3. Homogeneity: Need to Check by plotting residuals vs predicted values.

  4. Normality of error term: need to check by histogram, QQplot of residuals, even Kolmogorov-Smirnov test.

  5. Normality of random effect: Get the estimate of random effect (in your case random intercepts), and check them as check the residual. But it is not efficient because you just have 7 random intercepts.

    Another assumption is the independent between subjects. No test, based on your judgement. Subject specific random intercept means the correlation between the response variable from the same subject are the same.