I'm not a statistician so maybe my question is very simple but I've encountered some difficulties reading a statistical method in a cognitive psychology paper. Basically the dependent variable to model is a normal distribution where the mean and the standard deviation corresponds respectively to a systematic error in the experimental tasks and the precision in the task.

Authors report, without more reference or code, to perform a Hierarchical Linear Model:

We used HLM to examine the influence of trait anxiety, emotional valence, and their interaction effect on visual working memory resolution. The level-1 analysis included the within-individual variables (i.e., memory precision, two dummy variables indicating valence). The level-2 analysis included the betweenindividual variables (e.g., the standardized trait anxiety score). We used HLM 2 (measures within persons) to analyze the hierarchical model. Memory precision (i.e., the SD of error distribution) was entered as the outcome variable.

Given that I've a similar experiment, my question regards how to implement a HLM (I usually work with linear mixed-effects models) that model a standard deviation? Given that is basically a linear regression I should model the mean?

The reference is:

Yao, N., Chen, S., & Qian, M. (2018). Trait anxiety is associated with a decreased visual working memory capacity for faces. Psychiatry research, 270, 474-482 The second experiment, page 478


It doesn't necessarily matter that the outcome variable happens to be a standard deviation. That would be a decision made due to the research question. Since the researchers are interested in modelling precision, this would seem to be appropriate. The important thing, to make valid inferences, is that the distribution of the residuals is approximately normal. There is no requirement for the dependent variable to be normally distributed. This is the case in standard linear regression, and mixed effects models.

A Hierarchical Linear Model (HLM) is just another name for a multilevel model, and is special case of a mixed effects model.

  • $\begingroup$ Thanks for the answer! Yes, sure the assumptions are on residuals and not on the shape of the dependent variable per se. However, is not the same, talking about the same experimental design, to use the mean or the variance. I'm not able to imagine the model (for example in R) where a model the variance. $\endgroup$ – Filippo Gambarota Jan 1 at 19:41
  • $\begingroup$ Presumably each participant completed a number of tasks for which there was some type of score for each one. In the paper you cited, they took the standard deviation of these scores as the dependent variable. Indeed they could have used the mean, median or any other statistic derived from each person's scores. Since they were interested in precision, they used the SD. Had they been interested in accuracy they would have used a different statistic. So it depends on the research question. $\endgroup$ – Robert Long Jan 1 at 20:07

You can have a standard deviation as an outcome in a regression model, multilevel or otherwise. The question is whether doing so leads to a model that makes sense and does not violate any of the regression assumptions as it relates to normality of the residuals. Regarding the residuals, you will have to check that yourself by looking at residual plots (e.g., plot(lmer_model) and lattice::qqmath(lmer_model) in R).

Whether it makes sense to model the standard deviation is really a substantive issue. However, I am unclear how your data is set up. When you said standard deviation I assumed that you meant a measure of the spread of data for each person. If so, that would be a person-level variable. In dplyr code: df %>% group_by(id) %>% mutate(sd=sd(dep_var)). Unless you have data at a higher level of nesting, then I am not sure why you would need a multilevel model.

  • $\begingroup$ Thanks for the answer! yes, I've had a similar doubt because usually in experimental psychology the most used model is a linear regression with subject as random effect given that you have multiple observations per person. So using the variance you have a different structure of data. $\endgroup$ – Filippo Gambarota Jan 1 at 19:37

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.