I was wondering how to assess residual normality of a repeated measures ANOVA. In some threads, users refer to Venables and Ripley: Residuals in multistratum analyses: Projections and recommend to extract residuals using proj()
function. Is there any argument speaking against application of statistical normality tests, like shapioro wilk test?
Or would a mixed model (lmer
from lme4
package) be the better way?
Reproducible example:
library(MASS)
set.seed(123)
data<- data.frame(id = factor(rep(1:10, each = 4)),
cond1 = factor(rep(c("a", "b"), 20)),
cond2 = factor(rep(rep(c("x", "y"), each = 2), 10)),
Y = rnorm(40, 5, 2))
model<- aov(Y ~ cond1*cond2 +
Error(id/(cond1*cond2)), data = data)
model.pr <- proj(model)
shapiro.test(model.pr[[5]][, "Residuals"])