Dear R-helpers... I've be trying to run a variance analysis to compare means between various lines in various treatments. I have 10 genotypes (GEN), tested in 2 environments (ENV) and in each environment there are 3 repetitions (REP). Several traits were recoded (yield, flowering, plant height...) First I checked whether the residuals were normally distributed and then the homogeneity of variances. For those which satisfied the assumptions for ANOVA, I performed aov. I tested two models, one simple (GEN and ENV being fixed effects) and the other mixed effects (REP) aov1 <- aov (Y~GEN*ENV, data=mydata) aov2 < - aov (Y~GEN*ENV+Error(REP/ENV, data=mydata) When I wanted to compare the likelihood of these models, I failed performing the extractAIC for the mixed model (aov2). Is there any reason why extractAIC doesn't work in models including a random effect? As for other traits the assumption of homoscedasticity was violated I ran a lmer When I ran the following model lmer1 <- lmer(Y~GEN*ENV + (1|REP), data=mydata) the following error message came Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) : contrasts can be applied only to factors with 2 or more levels Could you please help me with this? Thanks Cecile [[alternative HTML version deleted]]