TECHNOLOGIESTieInn Technologies

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 →

Questions

Open in Code Lab5 free questions
5 questions

    Correlation vs causation

  1. Question 1easy

    Cities with more cafés have more crime. What's the most likely explanation?

  2. Correlation vs causation

  3. Question 2medium

    Two variables have a correlation of 0.02. Which is true?

  4. Correlation vs causation

  5. Question 3medium

    Customers who use the app spend more. How could you show the app causes higher spend?

  6. Correlation vs causation

  7. Question 4medium

    What does this print?

    print(products["price"].corr(products["stock"]) < 0)
  8. Correlation vs causation

  9. Question 5easy

    Which correlation shows the strongest relationship?

7 more questions on this topic, with hints, and tests

Sign up free for 21 days of every question and test.