Successfully reported this slideshow.
Upcoming SlideShare
×

Static Models of Continuous Variables

762 views

Published on

Raimundo Soto - Catholic University of Chile

ERF Training on Advanced Panel Data Techniques Applied to Economic Modelling

29 -31 October, 2018
Cairo, Egypt

Published in: Government & Nonprofit
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Real Ways To Make Money, Most online opportunities are nothing but total scams! โฒโฒโฒ http://scamcb.com/ezpayjobs/pdf

Are you sure you want to  Yes  No
• Be the first to like this

Static Models of Continuous Variables

1. 1. ERF Training Workshop Panel Data 2 Raimundo Soto Instituto de Economรญa, PUC-Chile
2. 2. STATIC MODELS OF CONTINUOUS VARIABLES 2
3. 3. MODEL STRUCTURE โข Canonical Model ๐ฆ๐๐ก = ๐ผ๐๐ก + ๐ฅ๐๐ก ๐ฝ + ๐๐๐ก where โข ๐ฆ๐๐ก is the phenomenon of interest to be modelled, โข ๐ฅ๐๐ก represents all observed controls (regressors) โข ๐ผ๐๐ก are the individual effects โข ๐๐๐ก is the non-systematic part (what we choose not to model) 3
4. 4. DATA STRUCTURE โข Let us stack the data in the it structure โข ๐ฆ11 ๐ฆ12 โฎ ๐ฆ1๐ ๐ฆ21 ๐ฆ22 โฎ ๐ฆ2๐ โฎ โฎ ๐ฆ ๐1 โฎ ๐ฆ ๐๐ 4
5. 5. DATA STRUCTURE EXAMPLE 5
6. 6. DATA STRUCTURE โข Let us stack the data in the it structure โข ๐ฆ11 ๐ฆ12 โฎ ๐ฆ1๐ ๐ฆ21 ๐ฆ22 โฎ ๐ฆ2๐ โฎ โฎ ๐ฆ ๐1 โฎ ๐ฆ ๐๐ = ๐ผ11 ๐ผ12 โฎ ๐ผ1๐ ๐ผ21 ๐ผ22 โฎ ๐ผ2๐ โฎ โฎ ๐ผ ๐1 โฎ ๐ผ ๐๐ + ๐ค11 ๐ค12 โฎ ๐ค1๐ ๐ค21 ๐ค22 โฎ ๐ค2๐ โฎ โฎ ๐ค ๐1 โฎ ๐ค ๐๐ ๐ฃ11 ๐ฃ12 โฎ ๐ฃ1๐ ๐ฃ21 ๐ฃ22 โฎ ๐ฃ2๐ โฎ โฎ ๐ฃ ๐1 โฎ ๐ฃ ๐๐ โฆ ๐ง11 ๐ง12 โฎ ๐ง1๐ ๐ง21 ๐ง22 โฎ ๐ง2๐ โฎ โฎ ๐ง ๐1 โฎ ๐ง ๐๐ ๐ฝ + ๐11 ๐12 โฎ ๐1๐ ๐21 ๐22 โฎ ๐2๐ โฎ โฎ ๐ ๐1 โฎ ๐ ๐๐ 6
7. 7. DATA STRUCTURE โข Let us stack the data in the it structure โข ๐ฆ11 ๐ฆ12 โฎ ๐ฆ1๐ ๐ฆ21 ๐ฆ22 โฎ ๐ฆ2๐ โฎ โฎ ๐ฆ ๐1 โฎ ๐ฆ ๐๐ = ๐ผ11 ๐ผ12 โฎ ๐ผ1๐ ๐ผ21 ๐ผ22 โฎ ๐ผ2๐ โฎ โฎ ๐ผ ๐1 โฎ ๐ผ ๐๐ + ๐ค11 ๐ค12 โฎ ๐ค1๐ ๐ค21 ๐ค22 โฎ ๐ค2๐ โฎ โฎ ๐ค ๐1 โฎ ๐ค ๐๐ ๐ฃ11 ๐ฃ12 โฎ ๐ฃ1๐ ๐ฃ21 ๐ฃ22 โฎ ๐ฃ2๐ โฎ โฎ ๐ฃ ๐1 โฎ ๐ฃ ๐๐ โฆ ๐ง11 ๐ง12 โฎ ๐ง1๐ ๐ง21 ๐ง22 โฎ ๐ง2๐ โฎ โฎ ๐ง ๐1 โฎ ๐ง ๐๐ ๐ฝ + ๐11 ๐12 โฎ ๐1๐ ๐21 ๐22 โฎ ๐2๐ โฎ โฎ ๐ ๐1 โฎ ๐ ๐๐ = ๐ผ + ๐ฅ๐๐ก ๐ฝ + ๐๐๐ก 7
8. 8. ESTIMATION IS IMPOSSIBLE โข If we allow for ๐ผ ๐๐ there will be ๐๐ constants (and, at most, NT observations), not enough degrees of freedom to estimate the parameters. โข We will restrict ourselves to: โ ๐ผ๐ , i.e., N constants (that do not change in time) โ ๐ ๐ก , i.e., T constants (that do not change by individual) 8
9. 9. POOLED ESTIMATOR โข Let us ignore all heterogeneity ๐ฆ๐๐ก = ๐ผ + ๐ฅ๐๐ก ๐ฝ + ๐๐๐ก โข The OLS estimator is: ๐ฝ = ๐ฅ๐๐ก โฒ ๐ฅ๐๐ก โ1 ๐ฅ๐๐ก โฒ ๐ฆ๐๐ก โข The variance estimator is ๐๐๐ ๐ฝ = ๐๐ 2 ๐ฅ๐๐ก โฒ ๐ฅ๐๐ก โ1 = ๐๐ 2 ๐(๐ฅ๐๐ก) โข Note the increase in precision (๐๐ฅ๐) 9
10. 10. FIXED EFFECTS ESTIMATOR โข Consider that the heterogeneity is only among individuals ๐ฆ๐๐ก = ๐ผ๐ + ๐ฅ๐๐ก ๐ฝ + ๐๐๐ก โข ๐ผ๐ represents individual characteristics that are fixed โข We could use binary (dummy) variables to represent fixed characteristics 10
11. 11. FIXED EFFECTS ESTIMATOR ๐ฆ11 ๐ฆ12 โฎ ๐ฆ1๐ ๐ฆ21 ๐ฆ22 โฎ ๐ฆ2๐ โฎ โฎ ๐ฆ ๐1 โฎ ๐ฆ ๐๐ = ๐ผ1 ๐ผ1 โฎ ๐ผ1 0 0 โฎ 0 โฎ โฎ 0 โฎ 0 0 0 โฎ 0 ๐ผ2 ๐ผ2 โฎ 0 โฎ โฎ 0 โฎ 0 โฆ 0 0 โฎ 0 0 0 โฎ 0 โฎ โฎ ๐ผ ๐ โฎ ๐ผ ๐ + ๐ค11 ๐ค12 โฎ ๐ค1๐ ๐ค21 ๐ค22 โฎ ๐ค2๐ โฎ โฎ ๐ค ๐1 โฎ ๐ค ๐๐ ๐ฃ11 ๐ฃ12 โฎ ๐ฃ1๐ ๐ฃ21 ๐ฃ22 โฎ ๐ฃ2๐ โฎ โฎ ๐ฃ ๐1 โฎ ๐ฃ ๐๐ โฆ ๐ง11 ๐ง12 โฎ ๐ง1๐ ๐ง21 ๐ง22 โฎ ๐ง2๐ โฎ โฎ ๐ง ๐1 โฎ ๐ง ๐๐ ๐ฝ + ๐11 ๐12 โฎ ๐1๐ ๐21 ๐22 โฎ ๐2๐ โฎ โฎ ๐ ๐1 โฎ ๐ ๐๐ 11
12. 12. FIXED EFFECTS ESTIMATOR โข ๐ฆ๐๐ก = ๐ผ๐ท + ๐ฅ๐๐ก ๐ฝ + ๐๐๐ก โข Note: same slope, different intercept (constant) โข All classic results on econometric estimation techniques hold: nature of the OLS estimator, optimality, goodness of fit, and asymptotic distributions of estimators and tests. โข This estimator is called LSDV least squares dummy variables. 12
13. 13. FIXED EFFECTS ESTIMATOR Group 2 Group 1 ๐ฅ ๐ฆ 13
14. 14. FIXED EFFECTS ESTIMATOR Group 2 Group 1 ๐ฅ ๐ฆ ๐ผ2 ๐ผ1 ๐ฆ2 = ๐ผ2 + ๐ฅ2ฮฒ ๐ฆ1 = ๐ผ1 + ๐ฅ1ฮฒ 14
15. 15. FIXED EFFECTS ESTIMATOR Group 2 Group 1 ๐ฅ ๐ฆ ๐ผ2 ๐ผ1 ๐ฆ2 = ๐ผ2 + ๐ฅ2ฮฒ ๐ฆ1 = ๐ผ1 + ๐ฅ1ฮฒ ๐ฆ = ๐ผ + ๐ฅฮฒ 15
16. 16. FIXED EFFECTS ESTIMATOR โข Example: โ Vial y Soto (2002) revise the opinion that โuniversity selection tests (PSU) do not predict student performance (R) in their faculties, only secondary-school marks are importantโ. โ When running the pooled regression: ๐๐๐ก = ๐ผ + ๐ฝ๐๐๐๐๐ก + ๐๐๐ก The estimated ๐ฝ is small, not significant or displays the โwrongโ sign (negative). 16
17. 17. PREDICTED EFFECT OF SELECTION TESTS ON STUDENTSโ PERFORMANCE Note: * significant at 10% size
18. 18. PREDICTED EFFECT OF SELECTION TESTS ON STUDENTSโ PERFORMANCE Note: * significant at 10% size
19. 19. POOLED ESTIMATOR ๐๐๐ ๐ 10 1 19 โLow-qualityโ faculties โHigh-qualityโ faculties
20. 20. FIXED EFFECTS ESTIMATOR ๐๐๐ ๐ 10 1 20 โLow-qualityโ faculties โHigh-qualityโ faculties
21. 21. POOLED VS FIXED EFFECTS ESTIMATORS ๐๐๐ ๐ 21 โLow-qualityโ faculties โHigh-qualityโ faculties
22. 22. POOLED VS FIXED EFFECTS ESTIMATORS ๐๐๐ ๐ 22 โLow-qualityโ faculties โHigh-qualityโ faculties
23. 23. FIXED EFFECTS ESTIMATOR โข LSDV estimator is unfeasible if N is too large โ HIECS has 24,000 households โข Recall that constants in regressions only take away the means of the variables โข It would be much simpler to eliminate the means of the variables and avoid specifying 24,000 dummy variables 23
24. 24. FIXED EFFECTS ESTIMATOR ๐ฆ๐๐ก = ๐ผ๐ + ๐ฅ๐๐ก ๐ฝ + ๐๐๐ก โข Let us take expected value for each individual โiโ in time: ๐ธ๐ ๐ฆ๐๐ก = ๐ธ๐ ๐ผ๐ + ๐ฅ๐๐ก ๐ฝ + ๐๐๐ก ๐ฆ๐ = ๐ผ๐ + ๐ฅ๐ ๐ฝ โข and subtract from the original model to eliminate ๐ผ๐: ๐ฆ๐๐ก โ ๐ฆ๐ = ๐ผ๐ + ๐ฅ๐๐ก ๐ฝ + ๐๐๐ก โ ๐ผ๐ โ ๐ฅ๐ ๐ฝ ๐ฆ๐๐ก โ ๐ฆ๐ = ๐ฅ๐๐ก โ ๐ฅ๐ ๐ฝ + ๐๐๐ก 24
25. 25. FIXED EFFECTS ESTIMATOR ๐ฆ๐๐ก โ ๐ฆ๐ = ๐ฅ๐๐ก โ ๐ฅ๐ ๐ฝ + ๐๐๐ก โข This is a very simple estimation, without the problems derived from dimensionality. โข Obviously, we cannot estimate ๐ผ๐, but they are easily recovered as: ๐ผ๐ = ๐ฆ๐ โ ๐ฅ๐ ๐ฝ 25
26. 26. FIXED EFFECTS ESTIMATOR Group 2 Group 1 ๐ฅ ๐ฆ ๐ผ2 ๐ผ1 26
27. 27. FIXED EFFECTS ESTIMATOR Group 2 ๐ฅ ๐ฆ Group 1 w/o means 27
28. 28. FIXED EFFECTS ESTIMATOR Groups 1 & 2 w/o means ๐ฅ ๐ฆ 28
29. 29. FIXED EFFECTS ESTIMATOR ๐ฅ ๐ฆ 29 Groups 1 & 2 w/o means
30. 30. FIXED EFFECTS ESTIMATOR ๐ฆ๐๐ก โ ๐ฆ๐ = ๐ฅ๐๐ก โ ๐ฅ๐ ๐ฝ + ๐๐๐ก โข This estimator uses only information within each group and it is therefore called within-groups estimator โข Let us obtain certain useful โsumsโ in order to better understand the nature of estimators. 30
31. 31. POOLED ESTIMATOR ๐ ๐ ๐ฅ๐ฅ = ๐=1 ๐ ๐ก=1 ๐ ๐ฅ๐๐ก โ ๐ฅ โฒ ๐ฅ๐๐ก โ ๐ฅ ๐ ๐ ๐ฅ๐ฆ = ๐=1 ๐ ๐ก=1 ๐ ๐ฅ๐๐ก โ ๐ฅ โฒ ๐ฆ๐๐ก โ ๐ฆ ๐ฝ ๐ = ๐ ๐ ๐ฅ๐ฆ ๐ ๐ ๐ฅ๐ฅ 31
32. 32. WITHIN-GROUPS ESTIMATOR ๐ ๐ค ๐ฅ๐ฅ = ๐=1 ๐ ๐ก=1 ๐ ๐ฅ๐๐ก โ ๐ฅ๐ โฒ ๐ฅ๐๐ก โ ๐ฅ๐ ๐ ๐ค ๐ฅ๐ฆ = ๐=1 ๐ ๐ก=1 ๐ ๐ฅ๐๐ก โ ๐ฅ๐ โฒ ๐ฆ๐๐ก โ ๐ฆ๐ ๐ฝ ๐ค = ๐ ๐ค ๐ฅ๐ฆ ๐ ๐ค ๐ฅ๐ฅ 32
33. 33. WITHIN-GROUPS ESTIMATOR โข From the pooled estimator ๐ ๐ ๐ฅ๐ฅ = ๐=1 ๐ ๐ก=1 ๐ ๐ฅ๐๐ก โ ๐ฅ โฒ ๐ฅ๐๐ก โ ๐ฅ ๐=1 ๐ ๐ก=1 ๐ ๐ฅ๐๐ก โ ๐ฅ๐ + ๐ฅ๐ โ ๐ฅ โฒ ๐ฅ๐๐ก โ ๐ฅ๐ + ๐ฅ๐ โ ๐ฅ ๐=1 ๐ ๐ก=1 ๐ ๐ฅ๐๐ก โ ๐ฅ๐ + ๐ฅ๐ โ ๐ฅ โฒ ๐ฅ๐๐ก โ ๐ฅ๐ + ๐ฅ๐ โ ๐ฅ ๐=1 ๐ ๐ก=1 ๐ ๐ฅ๐๐ก โ ๐ฅ๐ โฒ ๐ฅ๐ โ ๐ฅ + ๐=1 ๐ ๐ก=1 ๐ ๐ฅ๐ โ ๐ฅ โฒ ๐ฅ๐ โ ๐ฅ ๐ ๐ ๐ฅ๐ฅ = ๐ ๐ค ๐ฅ๐ฅ + ๐=1 ๐ ๐ก=1 ๐ ๐ฅ๐ โ ๐ฅ โฒ ๐ฅ๐ โ ๐ฅ 33
34. 34. WITHIN-GROUPS ESTIMATOR โข Thus ๐ ๐ ๐ฅ๐ฅ = ๐ ๐ค ๐ฅ๐ฅ + ๐=1 ๐ ๐ก=1 ๐ ๐ฅ๐ โ ๐ฅ โฒ ๐ฅ๐ โ ๐ฅ ๐ ๐ค ๐ฅ๐ฅ = ๐ ๐ ๐ฅ๐ฅ โ ๐=1 ๐ ๐ก=1 ๐ ๐ฅ๐ โ ๐ฅ โฒ ๐ฅ๐ โ ๐ฅ โข Double sums are either zero or positive (these are squares) hence ๐ ๐ค ๐ฅ๐ฅ โค ๐ ๐ ๐ฅ๐ฅ 34
35. 35. WITHIN-GROUPS ESTIMATOR โข The variance of the within-groups estimator is ๐๐๐ ๐ฝ ๐ค = ๐2 ๐=1 ๐ ๐ก=1 ๐ ๐ฅ๐๐ก โ ๐ฅ๐ โฒ ๐ฅ๐ โ ๐ฅ + ๐=1 ๐ ๐ก=1 ๐ ๐ฅ๐ โ ๐ฅ โฒ ๐ฅ๐ โ ๐ฅ ๐๐๐ ๐ฝ ๐ค = ๐2 ๐ ๐ ๐ฅ๐ฅ โ ๐=1 ๐ ๐ก=1 ๐ ๐ฅ๐ โ ๐ฅ โฒ ๐ฅ๐ โ ๐ฅ โข Therefore, this variance is larger than that of the pooled estimator โข The within-groups estimator is less precise than the pooled estimator 35
36. 36. LET US SEE THIS IN PRACTICE โข Open Stata โข Open file ERF_Continuous Static.do โ Declare Panel Data and Variables โข xtset โ Panel Data Analysis: commands xt โข xtdes โข xtsum โ Panel Data Regression โข xtreg โข Let us check the estimation results 36
37. 37. F test that all u_i=0: F(162, 5270) = 98.59 Prob > F = 0.0000 rho .95557807 (fraction of variance due to u_i) sigma_e .32607847 sigma_u 1.5123647 _cons -7.844568 .2477214 -31.67 0.000 -8.330205 -7.358932 l_popt .0731808 .0285325 2.56 0.010 .0172453 .1291163 l_infl2 -.0281481 .004758 -5.92 0.000 -.0374757 -.0188204 l_realgdp .3846652 .0153326 25.09 0.000 .354607 .4147234 l_money Coef. Std. Err. t P>|t| [95% Conf. Interval] corr(u_i, Xb) = -0.9200 Prob > F = 0.0000 F(3,5270) = 859.53 overall = 0.0036 max = 55 between = 0.0140 avg = 33.3 R-sq: within = 0.3285 Obs per group: min = 4 Group variable: idwbcode Number of groups = 163 Fixed-effects (within) regression Number of obs = 5436 _cons 3.315492 .0848041 39.10 0.000 3.149242 3.481742 l_popt .0014429 .0061381 0.24 0.814 -.0105903 .0134762 l_infl2 -.1650409 .0078825 -20.94 0.000 -.1804937 -.149588 l_realgdp -.0086728 .0036681 -2.36 0.018 -.0158636 -.0014819 l_money Coef. Std. Err. t P>|t| [95% Conf. Interval] Total 2454.44502 5435 .451599819 Root MSE = .64482 Adj R-squared = 0.0793 Residual 2258.61346 5432 .415797764 R-squared = 0.0798 Model 195.831563 3 65.2771875 Prob > F = 0.0000 F( 3, 5432) = 156.99 Source SS df MS Number of obs = 5436 37
38. 38. F test that all u_i=0: F(162, 5270) = 98.59 Prob > F = 0.0000 rho .95557807 (fraction of variance due to u_i) sigma_e .32607847 sigma_u 1.5123647 _cons -7.844568 .2477214 -31.67 0.000 -8.330205 -7.358932 l_popt .0731808 .0285325 2.56 0.010 .0172453 .1291163 l_infl2 -.0281481 .004758 -5.92 0.000 -.0374757 -.0188204 l_realgdp .3846652 .0153326 25.09 0.000 .354607 .4147234 l_money Coef. Std. Err. t P>|t| [95% Conf. Interval] corr(u_i, Xb) = -0.9200 Prob > F = 0.0000 F(3,5270) = 859.53 overall = 0.0036 max = 55 between = 0.0140 avg = 33.3 R-sq: within = 0.3285 Obs per group: min = 4 Group variable: idwbcode Number of groups = 163 Fixed-effects (within) regression Number of obs = 5436 _cons 3.315492 .0848041 39.10 0.000 3.149242 3.481742 l_popt .0014429 .0061381 0.24 0.814 -.0105903 .0134762 l_infl2 -.1650409 .0078825 -20.94 0.000 -.1804937 -.149588 l_realgdp -.0086728 .0036681 -2.36 0.018 -.0158636 -.0014819 l_money Coef. Std. Err. t P>|t| [95% Conf. Interval] Total 2454.44502 5435 .451599819 Root MSE = .64482 Adj R-squared = 0.0793 Residual 2258.61346 5432 .415797764 R-squared = 0.0798 Model 195.831563 3 65.2771875 Prob > F = 0.0000 F( 3, 5432) = 156.99 Source SS df MS Number of obs = 5436 Total Observations 38
39. 39. F test that all u_i=0: F(162, 5270) = 98.59 Prob > F = 0.0000 rho .95557807 (fraction of variance due to u_i) sigma_e .32607847 sigma_u 1.5123647 _cons -7.844568 .2477214 -31.67 0.000 -8.330205 -7.358932 l_popt .0731808 .0285325 2.56 0.010 .0172453 .1291163 l_infl2 -.0281481 .004758 -5.92 0.000 -.0374757 -.0188204 l_realgdp .3846652 .0153326 25.09 0.000 .354607 .4147234 l_money Coef. Std. Err. t P>|t| [95% Conf. Interval] corr(u_i, Xb) = -0.9200 Prob > F = 0.0000 F(3,5270) = 859.53 overall = 0.0036 max = 55 between = 0.0140 avg = 33.3 R-sq: within = 0.3285 Obs per group: min = 4 Group variable: idwbcode Number of groups = 163 Fixed-effects (within) regression Number of obs = 5436 _cons 3.315492 .0848041 39.10 0.000 3.149242 3.481742 l_popt .0014429 .0061381 0.24 0.814 -.0105903 .0134762 l_infl2 -.1650409 .0078825 -20.94 0.000 -.1804937 -.149588 l_realgdp -.0086728 .0036681 -2.36 0.018 -.0158636 -.0014819 l_money Coef. Std. Err. t P>|t| [95% Conf. Interval] Total 2454.44502 5435 .451599819 Root MSE = .64482 Adj R-squared = 0.0793 Residual 2258.61346 5432 .415797764 R-squared = 0.0798 Model 195.831563 3 65.2771875 Prob > F = 0.0000 F( 3, 5432) = 156.99 Source SS df MS Number of obs = 5436 Total Groups 39
40. 40. F test that all u_i=0: F(162, 5270) = 98.59 Prob > F = 0.0000 rho .95557807 (fraction of variance due to u_i) sigma_e .32607847 sigma_u 1.5123647 _cons -7.844568 .2477214 -31.67 0.000 -8.330205 -7.358932 l_popt .0731808 .0285325 2.56 0.010 .0172453 .1291163 l_infl2 -.0281481 .004758 -5.92 0.000 -.0374757 -.0188204 l_realgdp .3846652 .0153326 25.09 0.000 .354607 .4147234 l_money Coef. Std. Err. t P>|t| [95% Conf. Interval] corr(u_i, Xb) = -0.9200 Prob > F = 0.0000 F(3,5270) = 859.53 overall = 0.0036 max = 55 between = 0.0140 avg = 33.3 R-sq: within = 0.3285 Obs per group: min = 4 Group variable: idwbcode Number of groups = 163 Fixed-effects (within) regression Number of obs = 5436 _cons 3.315492 .0848041 39.10 0.000 3.149242 3.481742 l_popt .0014429 .0061381 0.24 0.814 -.0105903 .0134762 l_infl2 -.1650409 .0078825 -20.94 0.000 -.1804937 -.149588 l_realgdp -.0086728 .0036681 -2.36 0.018 -.0158636 -.0014819 l_money Coef. Std. Err. t P>|t| [95% Conf. Interval] Total 2454.44502 5435 .451599819 Root MSE = .64482 Adj R-squared = 0.0793 Residual 2258.61346 5432 .415797764 R-squared = 0.0798 Model 195.831563 3 65.2771875 Prob > F = 0.0000 F( 3, 5432) = 156.99 Source SS df MS Number of obs = 5436 Group Characteristics 40
41. 41. F test that all u_i=0: F(162, 5270) = 98.59 Prob > F = 0.0000 rho .95557807 (fraction of variance due to u_i) sigma_e .32607847 sigma_u 1.5123647 _cons -7.844568 .2477214 -31.67 0.000 -8.330205 -7.358932 l_popt .0731808 .0285325 2.56 0.010 .0172453 .1291163 l_infl2 -.0281481 .004758 -5.92 0.000 -.0374757 -.0188204 l_realgdp .3846652 .0153326 25.09 0.000 .354607 .4147234 l_money Coef. Std. Err. t P>|t| [95% Conf. Interval] corr(u_i, Xb) = -0.9200 Prob > F = 0.0000 F(3,5270) = 859.53 overall = 0.0036 max = 55 between = 0.0140 avg = 33.3 R-sq: within = 0.3285 Obs per group: min = 4 Group variable: idwbcode Number of groups = 163 Fixed-effects (within) regression Number of obs = 5436 _cons 3.315492 .0848041 39.10 0.000 3.149242 3.481742 l_popt .0014429 .0061381 0.24 0.814 -.0105903 .0134762 l_infl2 -.1650409 .0078825 -20.94 0.000 -.1804937 -.149588 l_realgdp -.0086728 .0036681 -2.36 0.018 -.0158636 -.0014819 l_money Coef. Std. Err. t P>|t| [95% Conf. Interval] Total 2454.44502 5435 .451599819 Root MSE = .64482 Adj R-squared = 0.0793 Residual 2258.61346 5432 .415797764 R-squared = 0.0798 Model 195.831563 3 65.2771875 Prob > F = 0.0000 F( 3, 5432) = 156.99 Source SS df MS Number of obs = 5436 Different estimates 41
42. 42. F test that all u_i=0: F(162, 5270) = 98.59 Prob > F = 0.0000 rho .95557807 (fraction of variance due to u_i) sigma_e .32607847 sigma_u 1.5123647 _cons -7.844568 .2477214 -31.67 0.000 -8.330205 -7.358932 l_popt .0731808 .0285325 2.56 0.010 .0172453 .1291163 l_infl2 -.0281481 .004758 -5.92 0.000 -.0374757 -.0188204 l_realgdp .3846652 .0153326 25.09 0.000 .354607 .4147234 l_money Coef. Std. Err. t P>|t| [95% Conf. Interval] corr(u_i, Xb) = -0.9200 Prob > F = 0.0000 F(3,5270) = 859.53 overall = 0.0036 max = 55 between = 0.0140 avg = 33.3 R-sq: within = 0.3285 Obs per group: min = 4 Group variable: idwbcode Number of groups = 163 Fixed-effects (within) regression Number of obs = 5436 _cons 3.315492 .0848041 39.10 0.000 3.149242 3.481742 l_popt .0014429 .0061381 0.24 0.814 -.0105903 .0134762 l_infl2 -.1650409 .0078825 -20.94 0.000 -.1804937 -.149588 l_realgdp -.0086728 .0036681 -2.36 0.018 -.0158636 -.0014819 l_money Coef. Std. Err. t P>|t| [95% Conf. Interval] Total 2454.44502 5435 .451599819 Root MSE = .64482 Adj R-squared = 0.0793 Residual 2258.61346 5432 .415797764 R-squared = 0.0798 Model 195.831563 3 65.2771875 Prob > F = 0.0000 F( 3, 5432) = 156.99 Source SS df MS Number of obs = 5436 Different Fit 42
43. 43. BETWEEN-GROUPS ESTIMATOR โข Recall that the regression model goes through the averages (mean) of variables ๐ธ๐ ๐ฆ๐๐ก = ๐ธ๐ ๐ผ๐ + ๐ฅ๐๐ก ๐ฝ + ๐๐๐ก โข We can run a regression on the means of each group ๐ฆ๐ = ๐ผ + ๐ฅ๐ ๐ฝ 43
44. 44. BETWEEN-GROUPS ESTIMATOR Group 2 Group 1 ๐ฅ ๐ฆ 44
45. 45. BETWEEN-GROUPS ESTIMATOR Group 2 Group 1 ๐ฅ ๐ฆ 45
46. 46. BETWEEN-GROUPS ESTIMATOR Group 2 Group 1 ๐ฅ ๐ฆ 46 ๐ฆ๐ = ๐ผ + ๐ฅ๐ ๐ฝ
47. 47. BETWEEN-GROUPS ESTIMATOR โข Letยดs look at the estimator using sums ๐ ๐ ๐ฅ๐ฅ = ๐=1 ๐ ๐ก=1 ๐ ๐ฅ๐ โ ๐ฅ โฒ ๐ฅ๐ โ ๐ฅ ๐ ๐ ๐ฅ๐ฆ = ๐=1 ๐ ๐ก=1 ๐ ๐ฅ๐ โ ๐ฅ โฒ ๐ฆ๐ โ ๐ฆ ๐ฝ ๐ = ๐ ๐ ๐ฅ๐ฆ ๐ ๐ ๐ฅ๐ฅ 47
48. 48. BETWEEN-GROUPS ESTIMATOR โข Note that ๐ ๐ ๐ฅ๐ฅ = ๐ ๐ค ๐ฅ๐ฅ + ๐ ๐ ๐ฅ๐ฅ ๐ ๐ ๐ฅ๐ฆ = ๐ ๐ค ๐ฅ๐ฆ + ๐ ๐ ๐ฅ๐ฆ โข Hence ๐ฝ ๐ = ๐น ๐ค ๐ฝ ๐ค + ๐ผ โ ๐น ๐ค ๐ฝ ๐ ๐น ๐ค = ๐ ๐ค ๐ฅ๐ฅ ๐ ๐ค ๐ฅ๐ฅ + ๐ ๐ ๐ฅ๐ฅ 48
49. 49. BETWEEN-GROUPS ESTIMATOR ๐ฝ ๐ = ๐น ๐ค ๐ฝ ๐ค + ๐ผ โ ๐น ๐ค ๐ฝ ๐ โข The pooled estimator is a weighted average of the between and within-group estimators โข Weights depend on the information content of the data: โ If groups are very similar, information comes from individuals within groups โ If groups are very different, information comes from differences between groups 49
50. 50. RESULTS BETWEEN-GROUPS ESTIMATOR 50 _cons 2.450055 .4769026 5.14 0.000 1.508174 3.391936 l_popt .008753 .029578 0.30 0.768 -.0496633 .0671694 l_infl2 -.4064124 .0650977 -6.24 0.000 -.53498 -.2778448 l_realgdp -.0062972 .0168565 -0.37 0.709 -.0395887 .0269942 l_money Coef. Std. Err. t P>|t| [95% Conf. Interval] sd(u_i + avg(e_i.))= .5167678 Prob > F = 0.0000 F(3,159) = 14.81 overall = 0.0787 max = 55 between = 0.2185 avg = 33.3 R-sq: within = 0.0155 Obs per group: min = 4 Group variable: idwbcode Number of groups = 163 Between regression (regression on group means) Number of obs = 5436 . xtreg l_money l_realgdp l_infl2 l_popt, be
51. 51. ESTIMATING THE VARIANCE OF RESIDUALS โข Compute the sample residuals as: ๐๐๐ก = ๐ฆ๐๐ก โ ๐ผ๐ โ ๐ฅ๐๐ก ๐ฝ โข The residual variance estimator is simply: ๐2 = ๐=1 ๐ ๐ก=1 ๐ ๐ฆ๐๐ก โ ๐ผ๐ โ ๐ฅ๐๐ก ๐ฝ 2 ๐๐ โ ๐ โ ๐พ 51
52. 52. HYPOTHESIS TESTING โข Having the estimated parameters and the residual variance estimator hypotheses testing is straightforward โ Individual parameter tests distribute t in small samples and Normal in large samples โ Multiple parameter tests distribute ๐2 or ๐น(๐, ๐) 52
53. 53. TWO-WAY FIXED EFFECTS ESTIMATOR โข Model with fixed individual effects and fixed time effects ๐ฆ๐๐ก = ๐ผ๐ + ๐ ๐ก + ๐ฅ๐๐ก ๐ฝ + ๐๐๐ก where โข ๐ ๐ก is a time effect affecting equally all individuals โข ๐ผ๐ is, again, an individual effect for all times 53
54. 54. RESULTS OF THE TWO-WAY ESTIMATOR 54 1966 .1359131 .0705045 1.93 0.054 -.0023053 .2741315 1965 .1098147 .0730354 1.50 0.133 -.0333653 .2529947 1964 .1550872 .0736255 2.11 0.035 .0107504 .2994241 1963 .1448196 .0739148 1.96 0.050 -.0000844 .2897236 1962 .0419273 .0757742 0.55 0.580 -.1066219 .1904766 1961 -.0976766 .0752323 -1.30 0.194 -.2451635 .0498103 year l_popt -.1974149 .0380194 -5.19 0.000 -.2719489 -.1228809 l_infl2 -.0301174 .0054168 -5.56 0.000 -.0407367 -.0194982 l_realgdp .2112165 .0187937 11.24 0.000 .1743731 .24806 l_money Coef. Std. Err. t P>|t| [95% Conf. Interval] Total 2454.44502 5435 .451599819 Root MSE = .31621 Adj R-squared = 0.7786 Residual 521.554775 5216 .09999133 R-squared = 0.7875 Model 1932.89024 219 8.82598285 Prob > F = 0.0000 F(219, 5216) = 88.27 Source SS df MS Number of obs = 5436 โฎ โฎ โฎ โฎ โฎโฎ โฎ