📈 Intro to Statistics · Lesson 5 of 7
Correlation and regression
Scatterplots, r, the line of best fit — and causation.
Scatterplots first
Always plot two quantitative variables before calculating anything. Look for direction (positive/negative), form (linear/curved), strength, and outliers.
The correlation coefficient r
| Range | −1 to +1 |
|---|---|
| r near +1 | Strong positive linear relationship |
| r near −1 | Strong negative linear relationship |
| r near 0 | No linear relationship (there may still be a curved one) |
| No units | Changing units doesn’t change r |
The regression line
The least-squares line ŷ = a + bx predicts y from x. Example: predicting exam score from hours studied, ŷ = 58 + 4.5x. The slope means: each extra hour of study is associated with 4.5 more points, on average. Someone who studies 6 hours is predicted to score 58 + 27 = 85.
r² and limits
r² is the fraction of the variation in y explained by the line (r = 0.8 → r² = 0.64, so 64%). Don’t extrapolate far beyond your data (20 hours of study doesn’t predict 148 points), and remember: correlation is not causation — a lurking variable may drive both.
In a spreadsheet
=CORREL(A2:A21, B2:B21) → r
=SLOPE(B2:B21, A2:A21) → b
=INTERCEPT(B2:B21, A2:A21) → aOr insert a scatter chart and add a trendline.
✏️ Practice: your turn
- Make a scatterplot of hours slept vs. a mood score for 10 days
- Estimate r by eye, then compute it with =CORREL
- Interpret the slope of a regression line in a sentence
- Name a possible lurking variable for “ice cream sales and drownings”
✏️ Scientific calculator with a statistics tab (mean, median, standard deviation)
🧠 Quick quiz
Answer all 4 questions correctly to mark this lesson as done.
0 of 4 correct
All lessons in Intro to Statistics
- 🎲 1. Data, variables and samplingCategorical vs. quantitative, populations, samples and bias
- 🎯 2. Mean, median and modeMeasures of center, and which one to use when data are skewed
- ↔️ 3. Spread: range, IQR and standard deviationHow spread out the data are, and how to read a box plot
- 🔔 4. The normal curve and z-scoresThe 68–95–99.7 rule and comparing values on different scales
- 📉 5. Correlation and regressionScatterplots, r, the line of best fit — and causation
- 🎯 6. Confidence intervalsEstimate ± margin of error, and what “95% confident” means
- ⚗️ 7. Hypothesis tests and p-valuesNull and alternative, the p-value, significance and errors