This site is designed solely for the use of Mr. Habib's MAT 120 classes. All rights reserved. No part of this site or its contents from MAT textbook (STATISTICS Informed Decisions Using Data by: Michael Sullivan, III) may be reproduced by any process without written permission by the author or publisher and/or Mr. Habib.
To Find the Least-Squares Regression Line
Example: For the data in the table below,
(a) Find the least-squares regression line.
(b) Interpret the slope and intercept.
(c) Predict the life expectancy of a resident of Italy where per capita GDP is $21.5 thousand.
(d) Compute the residual for Italy.
(e) Draw the least-squares regression line on the scatter diagram of the data.
|
Country |
Per Capita GDP, x |
Life Expectancy, y |
(x,y) |
|
Austria |
21.4 |
77.48 |
(21.4, 77.48) |
|
Belguim |
23.2 |
77.53 |
(23.2, 77.53) |
|
Finland |
20.0 |
77.32 |
(20.0, 77.32) |
|
France |
22.7 |
78.63 |
(22.7, 78.63) |
|
Germany |
20.8 |
77.17 |
(20.8, 77.17) |
|
Ireland |
18.6 |
76.39 |
(18.6, 76.39) |
|
Italy |
21.5 |
78.51 |
(21.5, 78.51) |
|
Netherlands |
22.0 |
78.15 |
(22.0, 78.15) |
|
Switzerland |
23.8 |
78.99 |
(23.8, 78.99) |
|
United Kingdom |
21.2 |
77.37 |
(21.2, 77.37) |
Press STAT, highlight 1: Edit and clear L1 and L2. Using table above, enter the variables of the predictor variable (per capita GDP) into L1 and the values of the response variable (life expectancy) into L2. Press STAT, highlight CALC and select 4:LinReg(ax+b). This command has several options. One option allows you to tore the regression equation into one of the Y-variables. To use this option, with the cursor flashing on the line LinReg(ax+b), press VARS.
Higlight Y-VARS.
Select 1: Function and press ENTER.
Notice that 1:Y1 is highlighted. Press ENTER.
Press ENTER.
The
output displays the general form of the regression equation y=ax+b followed by
values for a and b. Next,
,
the coefficient of determination, and r, the correlation coefficient, are
displayed. If you put the values of a and b into the general equation, you
obtain the specific linear equation for this data: y= .42x + 68.7151. Press Y=
and see that this specific equation has been pasted to Y1. (Note: The numerical
value for ‘b’ varies slightly from the book’s value on pg. 211. This difference
is simply due to rounding.)
Press 2nd
,
select 1: Plot 1, turn ON Plot 1, select scatter plot, set Xlist to L1 and Ylist
to L2. Press ZOOM and 9.
This picture displays a scatter plot of the data and the regression line. The picture indicates a strong positive linear correlation between X and Y, which is confirmed by the r-value for .809.
You can use the regression equation stored in Y1 to predict Y-values for specific X-values. For example, suppose you would like to use the regression equation to predict the life expectancy for a resident of Italy where the GDP is $21.5. In other words, for X=21.5, what does the regression equation predict for Y? To find this value for Y, press VARS, highlight Y-VARS, select 1: Function, press ENTER , select 1:Y1 and press ENTER. Press ( 21.5 ) and press ENTER.
The output shows the predicted Y-value of 77.75 for the input X-value of 21.5.
The residual for Italy is : the actual Y-value for Italy (78.51)- the predicted Y-value for Italy (77.75).