Correlation, Causation & Confounding Simulator
Two variables can move together for three very different reasons: one moves the other, the movement is a coincidence, or a third variable is quietly driving both. This simulator builds the third case — and the genuine case — in front of you: pick a story, set the third variable's strength, and then hold it fixed to see what is left of the correlation.
How it works
The data is generated from a hidden third variable Z. In the manufactured mode, X and Y are each built from Z plus their own noise — neither touches the other — so any correlation between them is Z's work alone. In the direct mode, X genuinely feeds Y, and Z merely makes people differ in X. Every run is seeded (the mulberry32 generator), so the sample you see is reproducible — the same runs the site's tests verify.
The honest check is the partial correlation, computed exactly from the three pairwise correlations: rxy.z = (rxy − rxz·ryz) ÷ √((1 − rxz2)(1 − ryz2)). It asks: among people who are equal on Z, do X and Y still move together? The coloured view answers the same question geometrically — split the sample into thirds by Z and fit each third separately. Two honest limits, stated plainly: a partial correlation near zero shows the association was carried by Z, but a surviving partial does not by itself prove causation — some other unmeasured variable, or reverse causation, could still be the story. All math runs client-side and is verified against independently computed reference values — see Software & sources.