Fitting Linear
Functions to Data
Compute and interpret the correlation coefficient \( r \) to measure how well a linear model fits a scatter plot of data.
Starting With a Scatter Plot
When we collect paired data (like hours studied and test scores), we plot each pair as a point. The resulting scatter plot shows whether the two variables move together.
The Line of Best Fit
A linear model (the line of best fit) summarizes the trend with the equation \( \hat{y} = a + bx \), where \( b \) is the slope and \( a \) is the \( y \)-intercept. It minimizes the total squared distance to all points.
The Correlation Coefficient \( r \)
The correlation coefficient \( r \) is a single number that measures the strength and direction of a linear relationship. It always falls between \( -1 \) and \( +1 \).
The Formula for \( r \)
Though we usually compute \( r \) with technology, the formula shows what it measures: how the \( x \) and \( y \) values vary together relative to how they vary individually.
Each term standardizes a point's \( x \) and \( y \) values using the means \( \bar{x}, \bar{y} \) and standard deviations \( s_x, s_y \), then averages the products. Always use technology (calculator or spreadsheet) for real data.
What Different \( r \) Values Look Like
\( r \) vs. \( r^2 \)
Don't confuse the correlation coefficient \( r \) with the coefficient of determination \( r^2 \). They describe related but different things.
| \( r \) | \( r^2 \) | |
|---|---|---|
| Range | \( -1 \) to \( +1 \) | \( 0 \) to \( 1 \) |
| Shows sign? | Yes (direction) | No (always \( \geq 0 \)) |
| Meaning | Strength & direction | % of variation explained |
| Example | \( r = -0.8 \) | \( r^2 = 0.64 \) |
Correlation Is Not Causation
A high \( |r| \) means the variables are linearly associated, but it does not prove one causes the other. A hidden third variable may drive both.
Computing \( r \): Step by Step
Worked Example: Reading \( r \)
A regression on temperature vs. ice cream sales gives \( \hat{y} = 12 + 4.5x \) with \( r = 0.92 \). Interpret this result.
Worked Example: Finding \( r^2 \)
A study of car age vs. resale value reports \( r = -0.85 \). Compute \( r^2 \) and interpret both values.
Worked Example: Compare Two Fits
Two models predict exam scores. Model A has \( r = 0.74 \); Model B has \( r = -0.91 \). Which model fits its data better?
Common Mistakes
Interpreting \( |r| \): Quick Guide
| \( |r| \) Value | Strength | Fit Quality |
|---|---|---|
| \( 0.9 \leq |r| \leq 1 \) | Very strong | Excellent linear fit |
| \( 0.7 \leq |r| < 0.9 \) | Strong | Good fit |
| \( 0.4 \leq |r| < 0.7 \) | Moderate | Fair fit |
| \( 0 \leq |r| < 0.4 \) | Weak | Poor linear fit |
Question 1 of 5
Which value of \( r \) indicates the strongest linear relationship?
Question 2 of 5
A regression gives \( r = -0.6 \). What is \( r^2 \), and what does it mean?
Question 3 of 5
A scatter plot shows points trending downward in a tight line. Which \( r \) value fits best?
Question 4 of 5
Sunscreen sales and shark attacks both have \( r = 0.85 \) with summer days. What can we conclude?
Question 5 of 5
According to the strength guide, an \( |r| \) value of \( 0.55 \) describes which kind of fit?