Unit 2: Exploring Two-Variable Data
Linear Regression
Fitting a least-squares regression line and assessing it with residuals and r².
Prerequisites
- Two-Way Tables
The Line That Minimizes the Misses
Hours studied and exam score for 6 students: (1,65), (2,70), (3,80), (4,82), (5,88), (6,95). Before reading on: infinitely many lines could be drawn through this scatter of points — what would make one particular line the 'best' summary of the relationship?
Definition — Least-Squares Regression Line
Worked Example — Computing the Regression Line by Hand
Worked Example — Assessing the Fit with Residuals and r²
Graph Visualizer
Domain & range
Evaluate a point
- x^2 = 0
Tip
Common Mistakes
Using the regression line to predict a value far outside the range of x actually observed.
A regression line is only trustworthy for interpolation (predicting within the observed range of x) — extrapolating beyond it, like predicting the score for 0 or 20 hours studied here, assumes the linear pattern continues, which the data can't confirm.
Reporting r² as a percentage of something other than variation explained, e.g. 'the model is correct 98% of the time.'
r² specifically measures the proportion of variation in y explained by the linear relationship with x — it isn't an accuracy rate or a probability of a correct prediction.
Key Takeaways
- The least-squares regression line minimizes the sum of squared residuals, which is why residuals always sum to exactly 0 for a correctly computed line.
- The slope and intercept have specific context-based interpretations; using the intercept for x-values outside the observed data range is extrapolation.
- r² measures the proportion of variation in y explained by the linear relationship — it does not establish causation.
Summary
This closes Unit 2. Unit 3 turns from describing already-collected data to how that data should be collected in the first place, so its conclusions can actually be trusted.
Sign in to track your progress and mark this lesson complete.
Track your progress