ch18Aleastsquaresregressionline0

ch18Aleastsquaresregressionline0 - Chapter 18B: Chapter...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Chapter 18B: Chapter Explanation of “Least Squares” Regression Line Example: Example A substance used in biological and medical substance research is shipped by airfreight to users in cartons of 1,000 ampoules. The data below, involving 10 shipments, were collected on the number of times the carton was transferred from one aircraft to another over the shipment route (x) and the number of ampoules found to be broken upon arrival (y). (y). i xi yi 1 1 16 2 0 9 3 2 17 4 0 12 5 3 22 6 1 13 7 0 8 8 1 15 9 2 19 10 0 11 ˆ (a) Fit a least squares regression line y = a + bx to the data. (a) Solution: y = a + bx = 10.2 + 4 x ˆ (b) Does a linear regression model appear to give a good fit (b) for the data? for Solution: YES! The correlation coefficient is: r = 0.949157995 YES! ˆ (c) Using the least squares regression line, y = 10.2 + 4 x calculate the predicted number of broken ampoules for all ten shipments. for i xi yi 1 1 16 2 0 9 3 2 17 4 0 12 5 3 22 6 1 13 7 0 8 8 1 15 9 2 19 10 0 11 ˆ y 14.2 10.2 18.2 10.2 22.2 14.2 10.2 14.2 18.2 10.2 (d) Calculate the differences between the actual number of broken ampoules and the predicted number of broken ampoules for all ten shipments. number ˆ That is calculate the prediction error, ei = yi − yi That i xi yi 1 1 16 14.2 1.8 2 0 9 10.2 -1.2 3 2 17 18.2 -1.2 4 0 12 10.2 1.8 5 3 22 22.2 -0.2 6 1 13 14.2 -1.2 7 0 8 10.2 -2.2 8 1 15 14.2 0.8 9 2 19 18.2 0.8 10 0 11 10.2 0.8 ˆ y ei (e) Calculate ∑ei i =1 10 and 4 0 12 5 3 22 ∑e i =1 10 2 i i xi yi 1 1 16 2 0 9 3 2 17 6 1 13 7 0 8 8 1 15 9 2 19 10 0 11 total XXX XXX XXX ˆ y ei 14.2 10.2 18.2 10.2 22.2 14.2 10.2 14.2 18.2 10.2 1.8 -1.2 -1.2 1.8 -0.2 -1.2 -2.2 0.8 0.8 0.8 0 17.6 ei2 3.24 1.44 1.44 3.24 0.04 1.44 4.84 0.64 0.64 0.64 10 ∑e i =1 i =0 ∑e i =1 10 2 i = 17.6 Now suppose we do NOT use the regression coefficients a and b as calculated from the formulas to form the equation of the regression line. y = a + bx = 10.2 + 4 x regression ˆ Suppose we choose the equation of the Suppose regression line to be y = 10 + 3 x regression ˆ Now let’s calculate the predicted values and Now prediction errors for this other line. prediction (f) Let’s use the new equation (f) ˆ y = 10 + 3 x 7 0 8 10 -2 4 8 1 15 13 2 4 9 2 19 16 3 9 10 0 11 10 1 1 i xi yi 1 1 16 13 3 9 2 0 9 10 -1 1 3 2 17 16 1 1 4 0 12 10 2 4 5 3 22 19 3 9 6 1 13 13 0 0 10 total XXX XXX XXX ˆ y ei 12 42 ei2 ∑e i =1 10 i ≠0 ∑e i =1 2 i = 42 ˆ Note that for y = a + bx = 10.2 + 4 x Note the sum of the squared errors is much the smaller than that for y = 10 + 3 x ˆ ∑e i =1 10 2 i = 17.6 < ∑e i =1 10 2 i = 42 Suppose this time we choose the equation of the regression line to be ˆ the y = 10 + 4 x Now let’s calculate the predicted values and Now prediction errors for this line. prediction i xi 1 1 16 14 2 4 2 0 9 10 -1 1 3 2 17 18 -1 1 4 0 12 10 2 4 5 3 22 22 0 0 6 1 13 14 -1 1 7 0 8 10 -2 4 8 1 15 14 1 1 9 2 19 18 1 1 10 0 11 10 1 1 total XXX XXX XXX yi ˆ y ei ei2 2 18 ˆ Note that for y = a + bx = 10.2 + 4 x Note the sum of the squared errors is much the ˆ smaller than that for y = 10 + 4 x ∑e i =1 10 2 i = 17.6 < ∑e i =1 10 2 i = 18 < ∑e i =1 10 2 i = 42 ˆ Conclusion: The regression line y = a + bx as The calculated by the formulas ALWAYS has the least squared error. the This is why we call it the least squares This regression line. regression ...
View Full Document

This note was uploaded on 02/22/2010 for the course FBE STAT0302 taught by Professor Unknown during the Spring '10 term at HKU.

Ask a homework question - tutors are online