Topic summary
Confounding

Generally speaking, a confounder is any third factor that is "mixed-with" an association: (typically a two-group comparison or a two-factor co variation), that can influence the association and that is not caused by anything in the association. A classic example is the monthly association between burglaries and ice-cream sales at high latitudes. The confounder, outside temperature, causes both factors to increase in summer and decrease in winter.
Taking into account (controlling for) a confounder can change the size and the direction of a quantitative association in four ways: reversal, nullification, decrease without reversal, or increase.
This reversal is called Simpson's paradox. Suppose that the best hospital in a region has the highest patient death rate. Simpson's paradox would occur If after taking into account (controlling for) the mix of patients (good condition vs poor condition), that same hospital had the lowest patient death rate.
In causal inference, confounding is a form of systematic error (or bias) that can distort estimates of causal effects in observational studies. A confounder is traditionally understood to be a variable that (1) independently predicts the outcome (or dependent variable), (2) is associated with the exposure (or independent variable), and (3) is not on the causal pathway between the exposure and the outcome. Failure to control for a confounder results in a spurious association between exposure and outcome.
Confounding is a causal concept rather than a purely statistical one, and therefore cannot be fully described by correlations or associations alone. The presence of confounders helps explain why correlation does not imply causation, and why careful study design and analytical methods (such as randomization, statistical adjustment, or causal diagrams) are required to distinguish causal effects from spurious associations.
Several notation systems and formal frameworks, such as causal directed acyclic graphs (DAGs), have been developed to represent and detect confounding, making it possible to identify when a variable must be controlled for in order to obtain an unbiased estimate of a causal effect.
Confounders are threats to internal validity.