Correlation vs causation
Statistics · 12 questions
Short notes
Key idea
Correlation measures how two numbers move together, from −1 to +1. It doesn't tell you that one causes the other: a third factor, chance, or reverse causation can create the same pattern.
Syntax
df["ads"].corr(df["sales"]) # Pearson
df.corr(numeric_only=True)
df["a"].corr(df["b"], method="spearman") # rank-based, for curves and outliers
- Near 0: no straight-line relation. ±0.7 or more: strong.
Example
Ice-cream sales and drowning deaths are positively correlated. Ice cream doesn't cause drowning: hot weather drives both. Temperature is the confounder.
Traps
- Confounders: a hidden third variable drives both.
- Reverse causation: busy stores hire more staff; staff don't create the crowd.
- Correlation only catches straight-line relations; a U-shape can have r ≈ 0. Always plot.
- One outlier can create or hide a correlation.
- To show cause, run an experiment (an A/B test) or use careful methods that control for confounders.
Want the full lesson with step-by-step examples, a project and a certificate? Statistics course, ₹120 →
- Question 1easy
Cities with more cafés have more crime. What's the most likely explanation?
- Question 2medium
Two variables have a correlation of 0.02. Which is true?
- Question 3medium
Customers who use the app spend more. How could you show the app causes higher spend?
- Question 4medium
What does this print?
print(products["price"].corr(products["stock"]) < 0)
- Question 5easy
Which correlation shows the strongest relationship?
Correlation vs causation
Correlation vs causation
Correlation vs causation
Correlation vs causation
Correlation vs causation
7 more questions on this topic, with hints, and tests
Sign up free for 21 days of every question and test.