What is a confounding variable, and how does randomising treatment assignment in an experiment remove confounding bias?

ML systems and evaluation, Causal inference
Level L1 Beginner. Length Short. Nature Th Theoretical.

What's being asked

Whether you know why correlation fails to imply causation in observational data and how randomisation fixes it.

Key idea

A confounder Z is a common cause of both the treatment T and the outcome Y, creating a spurious correlation between T and Y; randomisation makes T independent of Z, leaving only the causal effect.

Steps

  1. Define a confounder: a variable Z that influences both who receives the treatment T and what outcome Y occurs (for example, age affecting both exercise habits and heart health).
  2. Explain the bias: comparing treated and untreated groups in observational data mixes the true causal effect of T on Y with pre-existing differences in Z.
  3. Explain how randomisation works: assigning T randomly (such as by a coin flip) severs the link from Z to T, so treated and control groups have the same distribution of both observed and unobserved confounders in expectation.

Common mistakes

How long your answer should be

3–5 sentences with one concrete example.

Last checked on 4 December 2026.

Read this

Previous in ML systems and evaluation: What is the difference between demographic parity and equalised odds, and why can a perfect classifier violate demographic parity?
Next in ML systems and evaluation: What is the difference between a shadow deployment and a canary rollout when releasing a new ML model?