Worked examples · Sheet 2
Least-squares regression lines
Theory used:The least-squares line with an interceptCentered sums
Go to: Exercise 1Exercise 2
Exercise 1
Find the least-squares line with an intercept for , , and .
First calculate the means and their deviations for the centered sums. The predictor values differ, so is positive. This meets assumption of the least-squares line theorem, giving a unique slope.
The two extreme observations have same-sign deviations and contribute and to . The central observation has zero deviation in and contributes zero. Thus and the slope is .
Find the intercept using , equivalent to requiring the line to pass through the point of means . Substitution gives . As a check, . The positive slope means the fitted response increases by units when the predictor increases by one unit.
Exercise 2
Four measurements give the pairs , , , and . Find the fitted line with an intercept and evaluate it at .
The predictor values are distinct, so and the least-squares line is unique. The first pair contributes and the last to the centered sum of cross-products. The two middle pairs contribute and .
The negative contributions of the two extreme pairs outweigh the two middle contributions. Thus the slope is negative even though the second and third observations alone suggest an increase. The slope is , so the fitted response decreases by one unit for each additional unit of .
The intercept follows from , or . The fitted value at is . Since the observed predictor values extend only to , interpreting this value as a prediction requires extending the model beyond the sample.