# Correlation, Causation and Confounding

> Measuring relationships between variables and reasoning carefully about whether one actually causes the other. Free notes, key concepts, resources and a mini...

Canonical: https://www.internhack.in/roadmaps/tracks/data-analyst/correlation-causation
Last updated: 2026-11-28

Measuring relationships between variables and reasoning carefully about whether one actually causes the other.

Intermediate · about 4 hours · difficulty 3/5

Learn first: [Sampling, Bias and Data Collection](https://www.internhack.in/roadmaps/tracks/data-analyst/sampling-and-bias)

Stakeholders almost always want causal answers ("did the campaign increase sales?") while most business data only shows associations. Bridging that gap carefully is a core analyst skill.

### Measuring association

- **Pearson correlation** measures linear relationships between two numeric variables, from -1 to 1.
- **Spearman correlation** uses ranks; better for monotonic but non-linear or outlier-heavy data.
- Always plot a scatter first. Very different patterns can produce the same correlation coefficient (see Anscombe's quartet).

### Why correlation is not causation

- **Confounders**: a third factor drives both (hot weather drives ice cream sales and sunburn).
- **Reverse causation**: loyal customers use more features, not necessarily the other way round.
- **Selection effects** and coincidence in large searches for patterns.

### Getting closer to causality

- **Randomised experiments** (A/B tests) are the most reliable.
- **Natural experiments** and **difference-in-differences**: compare changes over time between affected and unaffected groups.
- **Controlling for confounders** with segmentation or regression, while accepting you can only control for what you measured.

### Language matters

Say "users who did X were 20% more likely to Y" rather than "X increases Y by 20%" unless you have causal evidence.

**Pitfall:** recommending big investments based on a correlation in observational data. Move on when you can list at least two alternative explanations for any correlation someone shows you.

## Key concepts

- **Pearson and Spearman correlation**
- **Scatter plots and Anscombe's quartet**
- **Confounding variables**
- **Reverse causation**
- **Difference-in-differences**
- **Causal language in reporting**

## Mini project

Using Gapminder or Our World in Data country indicators, find a strong correlation (e.g. internet usage vs life expectancy) and write up at least three alternative explanations and what data could separate them.

## Check yourself

Customers who use the mobile app spend more. List two reasons this might be true even if the app itself causes no extra spending.

## Free resources

- [Correlation does not imply causation](https://en.wikipedia.org/wiki/Correlation_does_not_imply_causation) (Wikipedia)
- [OpenIntro Statistics](https://www.openintro.org/book/os/) (OpenIntro)

Previous: [Hypothesis Testing and p-values](https://www.internhack.in/roadmaps/tracks/data-analyst/hypothesis-testing) · Next: [Linear and Logistic Regression for Analysts](https://www.internhack.in/roadmaps/tracks/data-analyst/regression-basics)

## More in Statistical Thinking for Decisions

- [Descriptive Statistics](https://www.internhack.in/roadmaps/tracks/data-analyst/descriptive-statistics)
- [Probability and Distributions](https://www.internhack.in/roadmaps/tracks/data-analyst/probability-distributions)
- [Sampling, Bias and Data Collection](https://www.internhack.in/roadmaps/tracks/data-analyst/sampling-and-bias)
- [Estimation and Confidence Intervals](https://www.internhack.in/roadmaps/tracks/data-analyst/confidence-intervals)
- [Hypothesis Testing and p-values](https://www.internhack.in/roadmaps/tracks/data-analyst/hypothesis-testing)
- [Correlation, Causation and Confounding](https://www.internhack.in/roadmaps/tracks/data-analyst/correlation-causation)
- [Linear and Logistic Regression for Analysts](https://www.internhack.in/roadmaps/tracks/data-analyst/regression-basics)
- [A/B Testing and Experiment Design](https://www.internhack.in/roadmaps/tracks/data-analyst/ab-testing)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Data Analyst Roadmap](https://www.internhack.in/roadmaps/tracks/data-analyst)
