I'm performing some linear mixed models for a psychological experiment. I'm not a statistician so my knowledge is limited. The basic idea is that: I have an experiment in which I model my response variable as a function of within-subject factors (Emotion, Mem) and a between-subject factor (Group). I use nlme:

fit <- lme(Score ~ Group + Emotion + Mem + Group:Mem, random= ~ 1 | Subject, 
           data = dati)

Where Group is a 2 level factor (Controls, Patients). Given that I have the assumption that the variance of the response variable is different between Controls and Patients I decided to insert a weight term for the variance weights = varIdent(form = ~1 | Group):

fit_var <- lme(Score ~ Group + Emotion + Mem + Group:Mem, 
               random = ~ 1 | Subject, data = dati,
               weights = varIdent(form = ~ 1 | Group))

My question is: if I compare these two models and the fit_var model is better (in terms of AIC, BIC, LRT) it's like testing also the variance component? In other words, can I say that allowing for the heteroscedasticity in the model, the response variable explanation is improved? Thanks!


Yes, these models are nested and therefore you can use a likelihood ratio test to compare them. This can be simply done using the anova() function, i.e.,

anova(fit, fit_var)

A significant p-value at your prespecified significance level would indicate that allowing for different variances for the error terms for the two groups improves the fit of the model.

| cite | improve this answer | |
  • $\begingroup$ Thanks! Can I also said that this like a test on variance? I mean if I want to statistically support the fact that the variance between groups is different I can perform an F Test or a Levene Test. However, I've been taught to limit the number of separated tests preferring a single model of analysis. In this case, if considering heteroscedasticity (i.e. different variances) improve the model fit, can I say that variances are statistically different? $\endgroup$ – Filippo Gambarota Jan 9 at 9:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.