Least-squares line from summary statistics
With x as the explanatory variable and y as the response variable, the slope uses the correlation and both spreads. Find b before a, and keep unrounded values until the final reporting step
- Assign the roles Use x for the explanatory variable and y for the response variable \(\displaystyle x=\text{EV},\quad y=\text{RV}\)
- Calculate the slope Multiply r by the response standard deviation divided by the explanatory standard deviation \(\displaystyle b=(-0.8)\frac{15}{10}=-1.2\)
- Calculate the intercept Subtract b times the explanatory mean from the response mean \(\displaystyle a=42-(-1.2)(10)=54\)
- Round at the end Use the exact slope when finding the intercept, then round the reported coefficients as requested \(\displaystyle \widehat{y}=54-1.2x\)
Worked example
For a data set, x is the explanatory variable and y is the response variable. Given r = −0.6, x̄ = 20, sₓ = 5, ȳ = 50 and sᵧ = 10, find the least-squares line
- \(\displaystyle b=r\frac{s_y}{s_x}=(-0.6)\frac{10}{5}=-1.2\)Use the response spread in the numerator and the explanatory spread in the denominator
- \(\displaystyle a=\bar{y}-b\bar{x}=50-(-1.2)(20)=50+24=74\)Use the unrounded slope in the intercept formula
- \(\displaystyle \widehat{y}=74-1.2x\)Substitute the intercept and slope into the least-squares form y-hat = a + bx
Common mistakes
Difficulty levels
Questions about this topic
Why is sᵧ in the numerator of the slope formula?+
The slope measures change in the response variable for a change in the explanatory variable, so the response spread is divided by the explanatory spread
Why must the unrounded slope be used to find the intercept?+
The intercept depends on b. Rounding b first can change the value of a, especially when the explanatory mean is not small
How can r be recovered from a least-squares slope?+
Rearrange b = r sᵧ ÷ sₓ to get r = b sₓ ÷ sᵧ, using the same explanatory and response roles
Can I use a calculator?+
A calculator is allowed unless a question is marked no calculator
Which year level and chapter is this?+
Year 11, VCE Units 1 & 2, General Mathematics, chapter 7: Bivariate data