# Account for variance differences in linear mixed-effect model?

I'm not an expert statistician so excuse me if the question is trivial or not clearly written. I'm performing some statistical analysis of experimental psychology research. Basically, I have an experiment in which subjects have to perform a computerized task with:

• 2 groups (control and clinical) - between-subject factor
• stimuli factors (different stimuli on the screen) - within-subject factor
• my response variable that is a continuous variable representing the performance

Both the mean and the standard deviation of my response variable represent the precision in the task and one of my hypothesis is that the clinical group performance is worst compare to controls (higher mean and higher SD)

Given that I have multiple observation on the same subject, I'm performing a linear mixed-effect model with subjects as random effect.

In R using the lme4 package the code is:

fit <- lmer(Response ~ Group * Factor1 * Factor2 + (1|Subjects), data = dati)


This works well for difference in mean, but I would like to include in the model (and comparing with the model without this term) that the variance in Response is different between levels of the Group variable (Controls and Clinical). I've seen this thread about including weights=varIdent(form=~1|Group) in the model fitted with nlme. But given that this term refers to the residual variance, I'm not sure that is what I need. Does including this term answer to my question?

• What are the observed variances ? – Robert Long Jan 4 '20 at 12:21
• Sorry, I'm not sure that I've understood the question. In my task, the variance of the response variable represents the precision. – Filippo Gambarota Jan 4 '20 at 12:51
• You said the variances are different in the 2 groups so I asked you what they are. I mean the value of those variances. – Robert Long Jan 4 '20 at 15:16
• I have a SD of 0.9 for the control group and 1.35 for the other group (collapsing all other factors) – Filippo Gambarota Jan 4 '20 at 15:18
• I'm a little confused. Please can you post the output from str(dati), summary(dati) and summary(fit) into the question. – Robert Long Jan 4 '20 at 16:09