Download presentation
Presentation is loading. Please wait.
Published byMuriel Chase Modified over 9 years ago
1
Calculating the Least Squares Regression Line Lecture 40 Secs. 13.3.2 Wed, Dec 6, 2006
2
The Least Squares Regression Line The equation of the regression line is The equation of the regression line is y ^ = a + bx. Thus, we need to find the coefficients a and b. Thus, we need to find the coefficients a and b. The formulas are The formulas are or
3
Example Consider again the data set Consider again the data set xy 23 35 59 612 916
4
Method 1 Compute the means and deviations for x and y. Compute the means and deviations for x and y. xy x – xy – y 23-3-6 35-2-4 5900 61213 91647 x = 5 y = 9
5
Method 1 Compute the squared deviations, etc. Compute the squared deviations, etc. xy x – xy – y(x – x) 2 (y – y) 2 (x – x)(y – y) 23-3-693618 35-2-44168 5900000 61213193 91647 4928
6
Method 1 Find the sums of the last three columns. Find the sums of the last three columns. xy x – xy – y(x – x) 2 (y – y) 2 (x – x)(y – y) 23-3-693618 35-2-44168 5900000 61213193 91647 4928 3011057
7
Method 1 Compute b: Compute b: Then compute a: Then compute a:
8
Method 2 Consider again the data Consider again the data xy 23 35 59 612 916
9
Method 2 Compute x 2, y 2, and xy for each row. Compute x 2, y 2, and xy for each row. xyx2x2 y2y2 xy 23496 3592515 59258145 6123614472 91681256144
10
Method 2 Then find the sums of x, y, x 2, y 2, and xy. Then find the sums of x, y, x 2, y 2, and xy. xyx2x2 y2y2 xy 23496 3592515 59258145 6123614472 91681256144 155515282 2545
11
Method 2 Then find the sums of x, y, x 2, y 2, and xy. Then find the sums of x, y, x 2, y 2, and xy. xyx2x2 y2y2 xy 23496 3592515 59258145 6123614472 91681256144 155515282 x = 25 y = 45 x 2 = 155 y 2 = 515 xy = 282 2545
12
Method 2 Compute b: Compute b: Then compute a: Then compute a:
13
Example The second method is usually easier. The second method is usually easier. By either method, we get the equation By either method, we get the equation y ^ = -0.5 + 1.9x.
14
TI-83 – Regression Line On the TI-83, we could use 2-Var Stats to get the basic summations. Then use the formulas for a and b. On the TI-83, we could use 2-Var Stats to get the basic summations. Then use the formulas for a and b. For our example, 2-Var Stats L 1, L 2 reports that For our example, 2-Var Stats L 1, L 2 reports that n = 5 n = 5 x = 25 x = 25 x 2 = 155 x 2 = 155 y = 45 y = 45 y 2 = 515 y 2 = 515 xy = 282 xy = 282
15
TI-83 – Regression Line Or we can use the LinReg function. Or we can use the LinReg function. Put the x values in L 1 and the y values in L 2. Put the x values in L 1 and the y values in L 2. Select STAT > CALC > LinReg(a+bx). Select STAT > CALC > LinReg(a+bx). Press Enter. LinReg(a+bx) appears in the display. Press Enter. LinReg(a+bx) appears in the display. Enter L 1, L 2. Enter L 1, L 2. Press Enter. Press Enter.
16
TI-83 – Regression Line The following appear in the display. The following appear in the display. The title LinReg. The title LinReg. The equation y = a + bx. The equation y = a + bx. The value of a. The value of a. The value of b. The value of b. The value of r 2 (to be discussed later). The value of r 2 (to be discussed later). The value of r (to be discussed later). The value of r (to be discussed later).
17
TI-83 – Regression Line To graph the regression line along with the scatterplot, To graph the regression line along with the scatterplot, Put the x values in L 1 and the y values in L 2. Put the x values in L 1 and the y values in L 2. Select STAT > CALC > LinReg(a+bx). Select STAT > CALC > LinReg(a+bx). Press Enter. LinReg(a+bx) appears in the display. Press Enter. LinReg(a+bx) appears in the display. Enter L 1, L 2, Y 1 Enter L 1, L 2, Y 1 Press Enter. Press Enter. Press Y= to see the equation. Press Y= to see the equation. Press ZOOM > ZoomStat to see the graph. Press ZOOM > ZoomStat to see the graph.
18
Example Find the regression line for the Calorie/Cholesterol data. Find the regression line for the Calorie/Cholesterol data. Calories (x) 350290330290320370280290310230 Cholesterol (y) 5020451535502025200
19
Example 200250300350400 Calories Cholesterol 0 10 20 30 50 40
20
Example Estimate the cholesterol content of sandwiches with 290 calories and 250 calories. Estimate the cholesterol content of sandwiches with 290 calories and 250 calories. Predict the cholesterol content of sandwiches with 500 calories and 1000 calories. Predict the cholesterol content of sandwiches with 500 calories and 1000 calories.
21
Example 200250300350400 Calories Cholesterol 0 10 20 30 50 40
22
Example 200250300350400 Calories Cholesterol 0 10 20 30 50 40
23
Example 200250300350400 Calories Cholesterol 0 10 20 30 50 40
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.