Professional Documents
Culture Documents
Budi Waluyo
FAKULTAS PERTANIAN
UNIVERSTAS BRAWIJAYA 2009
Metode kuadrat terkecil
1 b1
b0
The Least Square Method
yi xi yˆ i
y1 x1 b0 b1 x1
y2 x2 b0 b1 x2
y3 x3 b0 b1 x3
. . .
. . .
yn xn b0 b1 xn
n
Min Z (y i y i ) 2
i 1
n
Min Z (y i b0 b1 x i ) 2
i 1
Classic Minimization
n
Min Z (y i b0 b1 x i ) 2
i 1
yi xi yi
y1 x1 b0 b1 x 1
y2 x2 b0 b1 x 2
y3 x3 b0 b1 x 3
. . .
. . .
yn xn b0 b1 x n
n
Z (y i b0 b1 x i ) 2
i 1
i 1
Z n
2( 1 )( y i b0 b1 x i ) 0
b0 i 1
Z n
2( x i )( y i b0 b1 x i ) 0
b1 i 1
b0 and b1
( x y )
xy n
b1
( x ) 2
x 2
n
b0 y b1 x
Pizza Restaurant Example
We collect a set of data from random stores of our Pizza
restaurant example
1 2 58 116 4
2 6 105 630 36
3 8 88 704 64
4 8 118 944 64
5 12 117 1404 144
6 16 137 2192 256
7 20 157 3140 400
8 20 169 3380 400
9 22 149 3278 484
10 26 20 5252 676
( x y ) (140 )(1300 )
21040
xy n b1 10
b1
( x )2
2
(140 )
x 2
n
2528
10
2840
b1 5
568
b0
Y b0 b1 X
1300
Y 130
10
140
X 14
10
130 b0 5( 14 )
b0 60
Estimated Regression Equation
Y 60 5 X
Y 60 5(16)
Y 140 thousand dollars
Summary ; The Simple Linear Regression Model
where
Yi = observed value of the dependent variable
for the i th observation
Ŷi = estimated value of the dependent variable
for the i th observation
Summary ; The Least Square Method
( X i Yi )
XY
i i
n
b1
( X i )2
X i
2
n
• Y -Intercept for the Estimated Regression Equation
b0 Y b1 X
SSE = (Y - Ŷ )2
SSE : Pictorial Representation
y10 - ^y10
Y = 60+5x
SSE Computations
i Xi Yi
1 2 58
2 6 105
3 8 88
4 8 188
5 12 117
6 16 137
7 20 157
8 20 169
9 22 149
10 26 202
SSE Computations
i Xi Yi Ŷi = 60 + 5Xi
1 2 58 70
2 6 105 90
3 8 88 100
4 8 188 100
5 12 117 120
6 16 137 140
7 20 157 160
8 20 169 160
9 22 149 170
10 26 202 190
SSE Computations
y = ( yi) / n
y = 1300/10 =
130
This is our estimate for the next value of y.
Given an observation with values of yi and xi.
(yi –y ) is the error in using x to estimate yi.
SST = (y - y )2
SST : Pictorial Representation
y10 - y
yi = 130
SST Computations
i Xi Yi (Yi - Y ) (Yi - Y )2
1 2 58 -72 5184
2 6 105 -25 625
3 8 88 -42 1764
4 8 188 -12 144
5 12 117 -13 169
6 16 137 7 49
7 20 157 27 729
8 20 169 39 1521
9 22 149 19 361
10 26 202 72 5184
SSE = SST
1 r2 0
r2 = 14200/15730 = .9027
In other words, 90% of variations in y can be explained by the
regression line.
SST Calculations
SST (Y Y ) 2
(Y ) 2
SST Y 2
n
SST Calculations
( Y )2
SST Y 2
n
Observation Xi Yi Yi^2
1 2 58 3364
2 6 105 11025
3 8 88 7744
4 8 118 13924
5 12 117 13689
6 16 137 18769
7 20 157 24649
8 20 169 28561
9 22 149 22201
10 26 202 40804
1300 184730
X 2
n
Observation X Y XY Y^2 X^2
1 2 58 116 3364 4
2 6 105 630 11025 36
3 8 88 704 7744 64
4 8 118 944 13924 64
5 12 117 1404 13689 144
6 16 137 2192 18769 256
7 20 157 3140 24649 400
8 20 169 3380 28561 400
9 22 149 3278 22201 484
10 26 202 5252 40804 676
10 140 1300 21040 184730 2528
[ 21040 ( 140 )( 1300 ) / 10 ] 2
SSR 14200
2528 ( 140 ) / 10
2
SSR Calculations
r .9027
2
SST Y 2
( Y ) 2
/n
X X / n
2 2
X Y XY X2 Y2
1 14 14 1 196
3 24 72 9 576
2 18 36 4 324
1 17 17 1 289
3 27 81 9 729
SST Y 2
( Y ) 2
/n
X X / n
2 2
x = 10
y = 100
xy = 220
x2 = 24
y2 = 2114
24 10 / 5
2
SST 114
SSR
220 200
2
100
24 20
Example : Read Auto Sales
Alternatively; we could compute SSE and SST and then find
SSR = SST -SSE
rxy ( sign of b1 ) r 2
rxy ( sign of b1 ) r 2
rxy .9027
rxy .9501