Skip to content

Multilevel Models

  • Extend regression to include both fixed effects (external factors) and random effects (inherent variability).
  • Let you model group-level or subject-level variation by including variables such as school or age as random effects.
  • Produce more accurate estimates when data contain extra sources of variability beyond measured predictors.

Multilevel models, also known as hierarchical models or mixed-effects models, are a type of regression analysis that allows for both fixed and random effects. This means that the model can account for both variability that is inherent to the data (random effects) as well as variability that is due to external factors (fixed effects).

A multilevel model separates sources of variation into fixed effects and random effects. Fixed effects represent variability attributable to measured external factors (for example, a specific teaching method), while random effects capture inherent variability associated with groups or subjects in the data (for example, differences among schools or baseline differences across ages). By including random-effect terms for group-level variables, multilevel models adjust for between-group differences that could otherwise confound relationships between predictors and outcomes.

Students’ test scores and teaching method

Section titled “Students’ test scores and teaching method”

A study aims to understand the relationship between students’ math test scores and the type of teaching method used in their classroom. Here, the students’ test scores are the dependent variable, and the teaching method is the independent variable. The school that the students attend is included as a random effect because schools will likely differ in their overall levels of education, which could affect the students’ test scores. Including school as a random effect allows the model to account for this inherent variability.

A study examines the relationship between the amount of physical activity a person engages in and their overall health. The person’s level of physical activity is the independent variable, and their health is the dependent variable. The person’s age is included as a random effect because people of different ages will likely have different baseline levels of health, which could affect the relationship between physical activity and health. Including age as a random effect allows the model to account for this inherent variability.

  • Hierarchical models
  • Mixed-effects models