Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
SIMPLE REGRESSION
(Lec2-4)
1
Yi 1 2 ( ) ui
Xi
ln Yi ln X i ui
Yi 1 2 X i 3 X ui i
2
ˆ ˆ X uˆ
• On the basis of the SRF i
Y 1 2 i i
n n 2
i 1 i 1
Derivation of least squares estimates: Derivative partially
with respect to βˆ1 and βˆ2 we obtain:
n
( uˆi2 ) n n
i 1
2 ui 2 (Yi 1 2 X i ) 0
1 i 1 i 1
n
( uˆi2 ) n n
i 1
2 ui X i 2 X i (Yi 1 2 X i ) 0
2 i 1 i 1
i 1 2 Xi
Y nˆ ˆ (3.1.4)
i i 1 i 2 i
X Y ˆ
X ˆ
X 2 (3.1.5)
Solving the normal equations simultaneously, we obtain:
(3.1.6)
(3.1.7)
Nguyen Thu Hang- BMNV, FTU CS2 28
5. The Method of Ordinary Least Squares
Review:
X,Y independent: var(X + Y) = var(X) + var(Y)
X,Y dependent: var(X + Y) = var(X) + var(Y) + 2Cov(X,Y)
Covariance
n n
(X i X )(Yi Y ) Y X i i n. X .Y
cov( X , Y )
ˆ2 i 1
n
i 1
n
Nguyeni Thu Hang- BMNV, FTU
Var ( X )
( X X ) 2
CS2 X i
2
n.( X ) 2
29
i 1 i 1
5. The method of Ordinary Least Squares (OLS)
̂ 2
S xy ˆ1 Y ˆ2 X
S xx
• Where
S xy ( X i X )(Yi Y ) X iY inXY
S xx ( X i X ) X nX
2
i
2 2
S yy (Yi Y ) 2 Yi 2 nY 2
S xx 668 10 8 28 2
S xy 789 10 8 9,6 21
S yy 952 10 9,6 2 30,4
S xy 21
ˆ2 0,75
S xx 28
ˆ1 Y ˆX 9,6 0,75 8 3,6
• SRF: Yˆ 3,6 0,75 X
Nguyen Thu Hang- BMNV, FTU CS2 32
Example 1
• Eviews with Quick/Estimate Equation or Object /New
object/ Equation
• Stata: reg Y X
Variable Coefficient Std. Error t-Statistic Prob.
Yˆ 3.6 0.75 X
If working time increases by 1 hour, the estimated increase in
wages is about 75 cents.
E(ui / X i ) 0
• Each Y population corresponding to a given X is
distributed around its mean value with some Y
values above the mean and some below it. The
mean value of these deviations corresponding to
any given X should be zero.
• Note that the assumption E(ui | Xi) = 0 implies
that E(Yi | Xi) = β1 + β2Xi.
Yi = β1 + β2 (1/Xi ) + ui
Where:
• ˆσ2 is the OLS estimator of the true but unknown
σ2 and where the expression n−2 is known as the
number of degrees of freedom (df).
• is the residual sum of squares (RSS).
See 3.5.2, 83
The coefficient of
determination
r2 is a nonnegative quantity.
0 ≤ r2 ≤ 1
Pr ˆ1 t / 2 se(ˆ1 ) 1 ˆ1 t / 2 se(ˆ1 ) 1
Pr ˆ2 t / 2 se(ˆ2 ) 2 ˆ2 t / 2 se(ˆ2 ) 1
100(1-α)% confidence intervals for the coefficients:
0.4268 2 0.5914
(n 2)ˆ 2
(n 2)ˆ 2
2
2
/ 2 ,( n 2 )
2
1 / 2,( n2)
17.5246 2.1797
19.234 2 154.7336
- Left-tail test: H 0 : 0 , H1 : 0
- Compute:
ˆ 2
(n 2)
0
2
02
ESS / 1 R 2 (n 2)
Thus F
RSS /( n 2) 1 R2
follows the F distribution, (1, n-2) df.
or F (n 2)
2
Step 1: Compute F ESS / 1 R
1 R2
0
RSS /( n 2)
0
where
ˆ 1 (100 170) 2
var(Y0 ) 42.159 10.4759
10 33000
• The 95% confidence interval for true E(Y|X0) :
67.9010 E (Y | X 100) 82.8381
ˆ 1 ( X 0 X )2 (100 170) 2
se(Y0 Y0 ) ˆ (1
2
) 42.159 (1 0.1 ) 7.255
n i x 2
33000