AI, machine learning and deep learning · Introductory

WHAT ARE CONFOUNDING VARIABLES?

Written by SignalsLab

Early edition: these lessons are being reviewed.

Content

Summary

A confounding variable is a third factor that influences both the independent and dependent variables in a study, potentially creating a false association between them. For example, in research linking lack of exercise to weight gain, age acts as a confounder because it affects both activity levels and metabolic changes. Confounders are distinct from the primary variables of interest and differ from sampling biases like selection bias.

Intuition

When studying the relationship between two variables, such as exercise and weight, we often assume a direct causal link. However, a third factor might be driving both. If this third factor is not accounted for, it can distort the perceived relationship, making it seem like the independent variable causes the dependent variable when the association might be spurious. This is why identifying and controlling for confounders is critical in statistical analysis to ensure the validity of the conclusions drawn from the data.

Derivation

  1. Identify the independent variable (cause) and dependent variable (effect) in a study.
  2. Look for a third variable that influences both the independent and dependent variables.
  3. Recognize that this third variable, the confounder, is associated with both the cause and the outcome.
  4. Understand that the confounder can distort the perceived relationship between the independent and dependent variables.
  5. Distinguish confounding variables from sampling biases such as selection bias, under coverage bias, and survivorship bias.

Worked example

Problem

In a study investigating whether lack of exercise leads to weight gain, identify the confounding variable if age affects both activity levels and metabolic changes.

  1. Identify the independent variable: lack of exercise.
  2. Identify the dependent variable: weight gain.
  3. Identify a third factor that influences both: age.
  4. Confirm that age affects activity levels (independent variable) and metabolic changes (dependent variable).
  5. Conclude that age is the confounding variable.

Answer Age is the confounding variable.

Common mistakes

  • Confusing confounding variables with sampling biases like selection bias, under coverage bias, and survivorship bias.
  • Failing to recognize that a confounder must influence both the independent and dependent variables.
  • Assuming a direct causal relationship between the independent and dependent variables without considering potential confounders.

Animation

Animation coming soon

The animated version of this lesson is being prepared for the web. In the Signals AI app, lessons are drawn step by step.

Code

This is a text lesson: it has no animation code yet.

ccBYNC© 2026 SignalsLab. Lesson text shared as is under CC BY-NC 4.0.