Title: Economics 310
1Economics 310
- Lecture 2
- General Linear Model Continued.
2Estimation of Linear Model
- To find an estimator of the unknown coefficients
in the vector ?, we follow the least squares
procedure. - A given estimate of ? gives an estimate of the
mean function Eyt?1xt2?2xt3?3. - We want to choose an estimate such that the sum
of squared differences between each observation
yt and the estimate of the mean function Eyt is
a minimum.
3LS Objective function
4First Order Conditions
5First Order Conditions Cont.
6First Order Conditions in matrix form
7Least-squares solution
8General Solution
9OLS Shazam vs Matrix Alegbra
sample 1 20 read x1 x2 x3 generate a set of y
for y103x1-4x25x3e genr y103x1-4x25x3no
r(2) ols y x1 x2 x3 generate results using
matrix algebra genr x01 copy x0 x1 x2 x3
x matrix binv(x'x)x'y print b stop
10Results of Matrix Example
VARIANCE OF THE ESTIMATE-SIGMA2 135.55
STANDARD ERROR OF THE ESTIMATE-SIGMA 11.643
VARIABLE ESTIMATED STANDARD T-RATIO
PARTIAL STANDARDIZED ELASTICITY NAME
COEFFICIENT ERROR 16 DF P-VALUE CORR.
COEFFICIENT AT MEANS X1 2.9701
0.1076 27.61 0.000 0.990 0.3840
0.7246 X2 -4.0604 0.1318 -30.82
0.000-0.992 -0.3787 -1.0227 X3
5.0685 0.1244 40.75 0.000 0.995
0.5907 1.2387 CONSTANT 11.487 9.309
1.234 0.235 0.295 0.0000 0.0594
_ generate results using matrix algebra _genr
x01 _copy x0 x1 x2 x3 x _matrix
binv(x'x)x'y _print b B 11.48749
2.970102 -4.060408 5.068454
11Percapita Income Example
sample 1 20 format (A11,F7.0,F8.0,2F6.0) read
COUNTRY PCINC AGR IND SER /format CANADA
1536 13 43 45 SWEEDEN
1644 14 53 33 SWITZERLAND 1361 11 56 33 LUXEMBOU
RG 1242 15 51 34 U. KINGDOM 1105 4
56 40 DENMARK 1049 18 45 37 W. GERMANY
1035 15 60 25 FRANCE 1013 20 44 36 BELGUIM
1005 6 52 42 NORWAY
977 20 49 32 ICELAND 839 25 47 29 NETHERLAN
DS 810 11 49 40 AUSTRIA
681 23 47 30 IRELAND 529 36 30 34 ITALY
504 27 46 28 JAPAN
344 33 35 32 GREECE 324 56 24 20 SPAIN
290 42 37 21 PORTUGAL
238 44 33 23 TURKEY 177 79 12 9 ols
pcinc agr ind end
12Shazam OLS Results
_sample 1 20 _format(A13,F5.0,3F3.0) _read
COUNTRY PCINC AGR IND SER / format READ USES
FORMAT(A13,F5.0,3F3.0) _ols pcinc agr ind
REQUIRED MEMORY IS PAR 2 CURRENT PAR
2000 OLS ESTIMATION 20 OBSERVATIONS
DEPENDENT VARIABLE PCINC ...NOTE..SAMPLE RANGE
SET TO 1, 20 R-SQUARE 0.6231
R-SQUARE ADJUSTED 0.5788 VARIANCE OF THE
ESTIMATE-SIGMA2 67294. STANDARD ERROR OF
THE ESTIMATE-SIGMA 259.41 SUM OF SQUARED
ERRORS-SSE 0.11440E07 MEAN OF DEPENDENT
VARIABLE 767.10 LOG OF THE LIKELIHOOD
FUNCTION -137.922 VARIABLE ESTIMATED
STANDARD T-RATIO PARTIAL STANDARDIZED
ELASTICITY NAME COEFFICIENT ERROR 17
DF P-VALUE CORR. COEFFICIENT AT MEANS AGR
-14.205 8.219 -1.728 0.102-0.387
-0.6912 -0.5352 IND 3.5139
13.42 0.2618 0.797 0.063 0.1047
0.1926 CONSTANT 1029.9 792.0 1.300
0.211 0.301 0.0000 1.3425 _end
13Estimating the error variance
14Heuristic Explanation of unbiasness
Y
Estimate
Truth
X
15Sampling Properties
16Variance Covariance Matrix