03 Revisions L Regression
03 Revisions L Regression
03 Revisions L Regression
STAT2008/STAT6038
Revision of Simple Linear Regression
The Simple Linear Regression Model and the
Parameter Estimates
2
Y 0 1X
with the two numbers 0 and 1 given being the estimates of 0 and, 1
respectively. Note that the fitted line contains no error term since the error
random variable is expected to be zero.
Note
9
E(Y|X=x)
If we add in assumption of linearity we get
E Y | X x 0 1x
E Yi | X xi 0 1xi
In practice, the observed value will (almost
always) differ from the expected value.
Denote difference by greek epsilon, i
Mean of i will be zero
i Yi E Yi | X xi Yi 0 1 xi
Yi 0 1 xi i
Yi 0 1 xi i
12
Yi 0 1 xi i
is estimated by y b0 b1 x
How good is the estimate?
14
Look at the distance between the points (xi,yi) and the line.
Residual
15
n n
i
( y
i 1
y ) 2
i
( r ) 2
i 1
This is the least squares method
16
S ( 0 , 1 ) (Yi 0 1 X i )
i 1
Differentiating
S n
A) 2 (Yi 0 1 X i )
0 i 1
S n
B) 2 X i (Yi 0 1 X i )
1 i 1
Estimation
18
The regression line
19
0 Y 1 X
Y 0 1 X
( X , Y ) is on the fitted line
The Regression Line
20
Example
21
x 1 2 4 5 8
y 3 3 7 6 12
Scatterplot of y vs x
12
10
8
y
2
0 1 2 3 4 5 6 7 8
x
Want to find b0, b1 for y b0 b1 x
23
cov( x, y) 9.75
1 b1 2
1.3
sx 7.5
b y b x 6.2 1.3*4 1
0 0 1
So, least squares regression line is
24
y 1 1.3 x
Fitted Line Plot
y = 1.000 + 1.300 x
S 1.16905
12
R-Sq 92.5%
R-Sq(adj) 90.0%
10
8
y
2
0 1 2 3 4 5 6 7 8
x
Can find predicted values and residuals,
25
yi 1 1.3xi ri yi yi yi yi
2
x y