Вы находитесь на странице: 1из 10

Sample Problem

Find the least squares regression line for the data on incom
and food expenditures of seven households given in the Ta
Use income as independent variable and food expenditure
dependent variable.
Income Food Expenditure
(Hundreds of Dollars) (Hundreds of Dollars)
35 9
49 15
21 7
39 11
15 5
28 8
25 9

Income Food Expenditure


x (in hundred $)
35
y (in hundred $)
9
xy
315
x2
1225 Regre
49 15 735 2401
21 7 147 441
39 11 429 1521
15 5 75 225
28 8 224 784
25 9 225 625
212 64 2150 7222
Sxy =
Sx = 212 Sy = 64 2150 Sx2 = 7222

Step 1. Compute Sx, Sy, x and y.


Sx = 212
Sy 64
x = Sx/n 30.2857142857
y = Sy/n 9.1428571429

Step 2. Compute Sxy and Sx2.


Sxy 2150

Error S
Sx 2 7222

Step 3. Compute SSxy and SSxx.


SSxy = Sxy – {(Sx)( Sy)} / n

2150 13568 7

2150 1938.2857142857
Ssxy 211.7142857143

SSxx = Sx2 – (Sx)2 / n

7222 212 7
7222 44944 7
7222 6420.5714285714
801.4285714286

Step 4. Compute a and b.


b = SSxy / SSxx
a = y – bx
0.264171123

9.1428571429 0.264171 30.2857142857


The L
1.1422459893

Thus, our estimated regression model ŷ = a + bx is


ŷ 1.1422459893 + 0.264171123 x

1.1414 + 0.2642x
Using the estimated regression model, we can find the predicted value of y for any specific value of x. The
predicted value of food expenditure for this household is
ŷ = 1.1414 + (0.2642)(35)
1.1422459893 0.264171 35
9.245989
10.38824 dollars

The difference between the actual and predicted values gives the error of prediction for this household.
E= y – ŷ 9 10.38824 -1.3882352941
-138.8235294118 DOLLARS

Therefore, the error prediction is - $138.84. The negative error indicates that the predicted
value of y is greater than the value of y. Thus, if we use the regression model, this
household’s food expenditure is overestimated by $138.84.
data on incomes
iven in the Table.
d expenditure as
F o o d E x p e n d itu r e ( H u n d r e d o f D o lla r s )
Create a scatter diagram
Plot of Food Expenditure versus Income

16

12

4
10 20 30 40
Income (Hundred of Dollars)

Regression Model Equation


y = A + Bx + 
where:
y – is the dependent variable
x – is the independent variable
A – is the y-intercept or constant term
B – is the slope
 - random error term
Error Sum of Squares (SSE)
The error sum of squares, denoted by SSE, is
SSE = (y - ŷ)
where:
y = is the observe or actual value
ŷ = is the predicted value
e = random error for the sample regression model

The Least Squares Line


For the least squares regression line ŷ = a + bx
+ bx is
b = SSxy / SSxx a = y - bx
where:
SSxy = xy – {(x)(y)}/n SSxx = x2 – (
And “SS” stands for “sum of squares”

n= no of paired observations
SSxy = xy – {(x)(y)}/n SSxx = x2 – (
And “SS” stands for “sum of squares”

n= no of paired observations
Income
16

14

12
sus Income
10

8
Incom
6

0
10 15 20 25 30 35 40 45 50 55

40 50
ollars)

n
= a + bx

xx = x2 – (x)2/n
es”
xx = x2 – (x)2/n
es”
Income

50 55

Вам также может понравиться