Presentation is loading. Please wait.

Presentation is loading. Please wait.

Economics 310 Lecture 2 General Linear Model Continued.

Similar presentations


Presentation on theme: "Economics 310 Lecture 2 General Linear Model Continued."— Presentation transcript:

1 Economics 310 Lecture 2 General Linear Model Continued.

2 Estimation 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 E[y t ]=  1 +x t2  2 +x t3  3. We want to choose an estimate such that the sum of squared differences between each observation y t and the estimate of the mean function E[y t ] is a minimum.

3 LS Objective function

4 First Order Conditions

5 First Order Conditions Cont.

6 First Order Conditions in matrix form

7 Least-squares solution

8 General Solution

9 OLS – Shazam vs Matrix Alegbra sample 1 20 read x1 x2 x3 * generate a set of y for y=10+3x1-4x2+5x3+e genr y=10+3*x1-4*x2+5*x3+nor(2) ols y x1 x2 x3 * generate results using matrix algebra genr x0=1 copy x0 x1 x2 x3 x matrix b=inv(x'x)*x'*y print b stop

10 Results of Matrix Example VARIANCE OF THE ESTIMATE-SIGMA**2 = STANDARD ERROR OF THE ESTIMATE-SIGMA = VARIABLE ESTIMATED STANDARD T-RATIO PARTIAL STANDARDIZED ELASTICITY NAME COEFFICIENT ERROR 16 DF P-VALUE CORR. COEFFICIENT AT MEANS X X X CONSTANT |_* generate results using matrix algebra |_genr x0=1 |_copy x0 x1 x2 x3 x |_matrix b=inv(x'x)*x'*y |_print b B

11 Percapita Income Example sample 1 20 format (A11,F7.0,F8.0,2F6.0) read COUNTRY PCINC AGR IND SER /format CANADA SWEEDEN SWITZERLAND LUXEMBOURG U. KINGDOM DENMARK W. GERMANY FRANCE BELGUIM NORWAY ICELAND NETHERLANDS AUSTRIA IRELAND ITALY JAPAN GREECE SPAIN PORTUGAL TURKEY ols pcinc agr ind end

12 Shazam 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 = R-SQUARE ADJUSTED = VARIANCE OF THE ESTIMATE-SIGMA**2 = STANDARD ERROR OF THE ESTIMATE-SIGMA = SUM OF SQUARED ERRORS-SSE= E+07 MEAN OF DEPENDENT VARIABLE = LOG OF THE LIKELIHOOD FUNCTION = VARIABLE ESTIMATED STANDARD T-RATIO PARTIAL STANDARDIZED ELASTICITY NAME COEFFICIENT ERROR 17 DF P-VALUE CORR. COEFFICIENT AT MEANS AGR IND CONSTANT |_end

13 Estimating the error variance

14 Heuristic Explanation of unbiasness Truth Estimate Y X

15 Sampling Properties

16 Variance – Covariance Matrix


Download ppt "Economics 310 Lecture 2 General Linear Model Continued."

Similar presentations


Ads by Google