Ripetizioni di Analisi
EN

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 .

x y 121234567 O C
y^(x)=12+52x\hat y(x)=\frac{1}{2}+\frac{5}{2}x
The fitted line passes through C, the point of means. The projections give its coordinates (1, 3).

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.

Report a mistake

Where:

Ripetizioni di Analisi

Keep studying

With a free account, you can pick up where you left off and see your progress next time you visit.

Sign up for free

Already have an account? Sign in

Contents