0% found this document useful (0 votes)
36 views32 pages

Lecture 8 (Ch14) Advanced Panel Data Method

The document discusses advanced panel data methods, specifically focusing on fixed effects estimation to eliminate time-invariant unobserved effects. It outlines the process of transforming data through first differencing and within transformation, leading to the estimation of coefficients using OLS without an intercept. Additionally, it covers the implications of using fixed effects in regression models and introduces random effects estimation under the assumption that unobserved effects are uncorrelated with explanatory variables.

Uploaded by

何宗穎
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
36 views32 pages

Lecture 8 (Ch14) Advanced Panel Data Method

The document discusses advanced panel data methods, specifically focusing on fixed effects estimation to eliminate time-invariant unobserved effects. It outlines the process of transforming data through first differencing and within transformation, leading to the estimation of coefficients using OLS without an intercept. Additionally, it covers the implications of using fixed effects in regression models and introduces random effects estimation under the assumption that unobserved effects are uncorrelated with explanatory variables.

Uploaded by

何宗穎
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
Research Method Lecture 8 (Ch14) Advanced Panel Data Method Fixed effects estimation 4 Fixed effects estimation is another method to eliminate the time invariant unobserved effect. 4 Consider the following model Yit=Bot Bi Xi + BoXiet-- Axyctayuiy qd) The correlation between the fixed effect a; and the explanatory variables will cause biases in the estimated coefficients. 2 4 Thus, we need to eliminate a, from the estimation. The first differencing is one method. Another method is the following. 4 First, compute the sample average of variables for each individual. (That is, for i individual, you compute the time series sample average of each variables). Then, you have the following VY, = Bot BX + BX +-°°+ BX +4, +7, senree( 2) 4 Since a; is constant over time, a; term in the equation (2) does not have the over-bar. 3 4 Now, subtract (2) from (1). Then, you get the following equation. VY) = Bin — Xn) + Bo Xe — Fa) to + Be ie — Xa) + Uy - 0) 4 Notice that, this transformation eliminates the fixed effect a,. This transformation is called the within transformation. Note also that this transformation eliminates the constant as well. 4 Now, we simplify the notation by writing the above equation as: Vi = Bika t Bodin tet BX Fi, GB) where i’, =¥,~-7,. This is called the time-demeaned data on y. The same notation is used for the x- variables and u. 4 4 Finally, estimate the demeaned equation (3) using OLS. This is called the fixed effect estimation . 4 To repeat, you simply run the OLS for the following equation and it is called the fixed effect estimation.. Du = Bidin + Boks to + BX tl, 4 Note that you do not have the intercept in this model. The standard error for the fixed effect estimator 4 Now, define the fixed effects residual as Ui, =H, - (fx) tent B Xin) 4 Then, the unbiased estimator of the sample variance is given by =Total # of| observations. (T l n oT isthe # of period, | - 2 A 2 a: cross sectional N’ units) ~ Degreg’of freedom ee— # of parameters excluding the intercept = cross sectional units (+ of individuals, firms etc) 4 After computing the estimated sample variance 3, you can compute the standard errors for the parameters by applying the formula given in Handout 2. 4 Notice that, if you manually create the time- demeaned variables and apply OLS, the usual statistical software will compute the degree of freedom as NT-k. This will understate the standard errors. 4 In this case, you have to correct the sample standard errors by multiplying each standard error by \OT=HaT-F-a) . 4 Fortunately, STATA has a command that estimates the fixed effect model automatically with correct standard errors. 7 Estimating a, 4 Sometimes (not often though), a; ,itself is of interest. This can be easily estimated as: G,= Y,— BX, —+— BX 4 When you estimate a fixed effect model using STATA, STATA reports the ‘intercept’. Remember that, fixed effect does not have the intercept. What STATA is reporting is the average value of 4, . 8 Example 4 JTRAIN.dta is a three year panel data. In the first differenced model, we used only the first two years. Now use all the three years and estimate the following model. log(scrap),=B,+B,(grant);, +B, log(sales),,+B ,log(#employees),;, +B, (year88),,+B,(year89),.+a+u, Ex1. Estimate the model using OLS ignoring the presence of the fixed effect. Ex2. Estimate the model using the fixed effect model. Ex1. OLS result - use "D:\My Documents\IUI_teaching\Research Methodology\Wooldridge Econometrics resources\data\ JTRAIN.OTA", clear . tsset feode year panel variable: fcode (strongly balanced) time variable: year, 1987 to 198 delta: 1 unit req Tscrap grant Temploy Tsale 88 489 Source ss df MS Number of obs = 148 ————————— (5, Ws 3B Model | 3LASB1S 5 6.29159531 Prob > F = 0.009 Residual | 272.067651 142 L9201My3 R-sqared = = 0.104 ——_— adj R-squared = 0.0719 Total | 304125633 147 2.05888185 foot MSE = 1B Vscrap Coe. Std. Err. = tt] BSH Conf. Interval] grant | 1460224 318535 0.460.047 - 483504 7757012 lemploy | .fI9S0LF §=.200453 3.59 0.000 3230593 1.115544 Tsales | -.5983353 2072189 2.890.004 = -L007968 = -. 1887027 88 | -.179051 229787 0.59 0.555 7781368 «4197266 89 | -. 3786 973 = 1.370.173 9698004 1755721 cons | 7.007854 2569933 2.73 0.007 = 1.927583 12.08813 40 Fixed effect model xtreg Iscrap grant lemploy Isale d88 489, fe Fixed-effects (within) regression Number of obs 148 Group variable: fcode number of groups SL R-sq: within = 0.167 ‘obs per group: mi 1 between = 0.0111 av 29 overall = 0.0059 max = 3 F(5,92) = 3.0 corr(u_i, xb) = -0.0613 prob > F = 0.0051 scrap coef. std. Err. p> |e (95% conf. Interval] grant -1340168 0.510 -.3548169—.1775209 Temp] oy -3581686 0.967 7262814 6964261 Isales -2660989 0.806 © -.5939057 88 -1165089 0.429 -.3240376 489 -1168365 0.002 = -.6105629 Cons 1.570754 3.178357 0.622 -4.741738 7.883246 sigmau | 1.3991565 sigmae | .50390488 rho | .88518501 (fraction of variance due to ui) F(50, 92)= 19.64 F test that all u_i=0: Prob > F = 0.0000 Ex3. The fixed effect model above did not show statistically significant effects of the grant. It is probably because it takes some time for the effect of grants to appear. In order to capture this possibility, include the lag of grant. That is, estimate the following model. One year lag of the grant log(scrap);=Bo+B, (grant), +B,(grant)),.; +B,log(sales),,+B,log(#employees),, +B5(year88);,+B.(year89);,Fa+U;, This is called the distributed lag model. The lag of the captures the effect of receiving grant last year on this vear’s scrap rate. grant Fixed effect model with one year lag of the grant xtreg Iscrap grant grant_1 lemploy Isale d88 439, Fixec-effects (within) regression Number of obs = 148 Group variable: frode Number of groups = SL Resq: 0.2131 bs per group: min = 1 0.041 avg = 2.9 overall = 0.0004 max = 3 F(6,91) = 41 corr(ui, x0) = -0.2258 Prob > F = 0.0011 Iscrap coef. std. err. t Pe|t| [95% Conf. Interval] grant -1970861 0.062 -.6087863 015278 grat =224206 0.019 980936 -. 0902207 Jenp oy -3502902 0.828 -.7721764 6194405 Isales 72596985 0.739 -.6027167 4290014 83 71195487 0.974 +7335079 89 71536863 0392 - -173086 —£ons 3.10843 0.498 © -4.059034 8.289996 signa | 1.415155 signe | .49149057 rho | 189585692 (fraction of variance due to ui) F test that all wit: F(50, 91) = 20.75, Prob > F = 0.0000 The lag of grant has greater effect than current grant. This indicates that it takes time for the effect to appear. 13 Ex4. Finally, estimate the following fixed effect model by manually creating the time-demeaned variable. This is a good exercise for you to understand the exact procedure of the fixed effect estimation. log(scrap);,=Bo+B, (grant), +B,(year88);,+B;(year89),+a;+U;, + xtreg Tscrap grant 88 489, fe Fixed-effects Grithin) regression Nunber of obs 0 = ez Group variable: fcode Nunber of groups = ” Resqt within = O.170L Obs per group: min = 3 Getrmen = 90109 ng = 3.0 corr Gui, »b) Tscrap Coat, Std. Err tPeitl (85% Conf. Interval 0.516 -.3325706 _-1es424 07193 "'ss3519_Lorazean 8:000 -.6251903 —“2onae97 0:00 "Metzose "17338509 Cfraction of variance due to us) Prab > F = 0.0000 Feast that a1) uieoe «reg dalscrap dngrant dnd38 dnd89 FS, 105) = 23.90 Source 55 df MS {_________ = 10.80 Model | 5.48707962 3 1.82902661 = 0.0000 Residual | 26.762505 158 .169383168 = 0.1701 = 0.154 Total | 32.2496203 161 .200308701 Root MSE = A156 dil scrap Coef. Std. Err. t Pelt] [99% Conf. Interval] dngrant 1029302 0.80 0.426 © -.7RS5107 1710825 dnd 88 0870923 «1.61 0.110 -.3120812 0319493 dad 89 OBL -5.24 0.000 -. 5879437 -.2661363 -cons 0323354 = 0.00 1.000 -.0638653 .0638653 Fixed effect estimated automatically Fixed effect estimated by manually creating time-demeaned variables. Note the standard errors are wrong, so you have to correct them. 15 The do file SeREREEER ERE EE EERE EERE EERE * Mannually estimating the * * fixed effect model * eb ooo onbiiobiabiidei ok sort feode by feode: egen meanlscrap=mean(Iscrap) gen dmlscrap=Iscrap-meanlscrap by feode: egen meangrant=mean(grant) gen dmgrant=grant-meangrant by feode: egen meandS8=mean(d88) gen dmd88=d88-meand88 by feode: egen meand89=mean(d89) gen dmd89=d89-meand89 Sees EES *Estimate the model * eee eeererery reg dmlscrap dmgrant dmd88 dmds9 xtreg Iscrap grant d88 d89, fe 4 Note, when you estimate the fixed effect model, it is a good idea to tell your audience what the potential fixed effect would be and whether it is correlated with the explanatory variables. 4 Off course, one can never tell exactly what the fixed effect is since it is the aggregate effects of all the unobserved effects. However, if you tell what is contained in the fixed effect, your audience can understand the potential direction of the bias, and why you need to use the fixed effect model. The dummy variable regression 4 Consider again the following model. log(scrap),,=B,+B, (grant), +B,(year88),,+B,(year89),,+a+u;, We learned that fixed effect model can correct for the biases arising from the correlation between a; and the explanatory variables. 4 Now, consider instead that you include all the firm dummy variables in the model, and estimate the model using the usual OLS. 4 It is known that the slope coefficients and their standard errors obtained from this procedure are exactly the same as those obtained from the fixed effect estimation. 4 The coefficients for dummy variables will be the same as the fixed effect estimates for a;. 10 4 However, note that the coefficients for the dummy variables are not consistent when the number of periods (T) is fixed and the number of firms (N) gets large. This is because, when N gets large, the number of a; will increase. So no information accumulates on each a;. The Random Effect Estimation 4 Consider the following unobserved effect model. Y,, = By + BX + BoXnn to +B Xin H(G, +u,,)°-°) et 4 Previously, we applied the fixed effect estimation since we suspect that a; are correlated with some of the explanatory variables. 4 But if we can assume that a, are not correlated with any of the explanatory variables, we can estimate the model more efficiently (i.e., get smaller standard errors). 4 When a; are not correlated with any of the explanatory variables, pooled OLS will be consistent. 4 But the problem is now the serial correlation. That is, for a given person j, the composite error term v,, of this period and other periods are correlated. 4 To be more precise, assume the following. Cov(Xix, a)=0 for t=1,2,...,T, and j=1,2,...,k That is: a, is uncorrelated with all the explanatory variables in all the periods. 4 In addition, we assume that a, and the idiosyncratic errors in all the periods are uncorrelated. 4 Then we can show the following. Corr (v,.¥,) = 2+ # 0 ue o,+0, where o,7=var(a;) and o,7=Var(u;). Proof: See the front board. 23 4 Here is a way to eliminate the serial correlation. 4 Consider the following. ; ve: an1-[74 o,+To; 4 Then, the term v,, - Av, are not serially correlated. Thus, first consider the following. AY, = BA + BAX) + BAX.) +00 + B (AX, ) + AY,) (2) 24 4 Then, subtract (2) from (1) to get, (v, — AV) = Ay(l- A) + Bea - 21) + BX, — AR) te + BM — AX, + (VY, — AP) B) 4 Ascan be seen, the composite error term is , ~ 47, , and we know that this error term has no serial correlation. The transformed data are called the quasi-demeaned data . Therefore, if we apply the OLS to (3), we get the correct standard error. 4 One problem is that \ is an unknown parameter. So this has to be estimated. = The procedure to estimate A is the following. 1. Estimate (1) using OLS. Then estimate o,? 0,2 o, and as: y 1 63 =[\T(P-)/2-G4DE YY YI, v vor 62 =[\T -G +b) SY 3,7 = tI 2. Then estimate ) as: ape Aofl Laxziar| é:4Te: vl y y This is just the estunate of the sigma-squared estimated from the pooled OLS of (1). 3. Finally, replace ) in equation (3) with 7 and estimate the equation using OLS. This is called the Random Effect Estimation . 26 Example 4 Estimate a log wage equation using WAGEPAN.dta. Include in the model education, black, hispan, exper, exper squared, married, union, and full set of year dummies. 4 First, estimate the model using OLS 4 Next, estimate the model using the random effect. 4 Finally estimate the model using the fixed effect model. Why does STATA drops some of the variables? OLS = req Iwage educ black hisp exper expersq married union d81 d82 483 d34 d85 d86 487 source 3S df Ms Number of obs = 4360 EET FC 14, 4345) mode] 234.048277) 14 16. 7177341 Prob > F Residual 1002.48136 4345 .230720682 R-squared ss sy)st Adj R-squared Total 1236.52964 4359 .283672779 Root MSE wage coef. std. err. t P>|t] (85% conf. Interval] educ | 0913498 0052374 17.44 0.000 = 0810819. 1016177 black | -.1392342 .0235796 = -5.90 0.000 = -. 1854622 -.0930062 hisp 0160195 .0207971 0.77 0.441 -.0247535 -0567925 exper | 0672345 0136948 = 4.91 0.000 = 0403856 = .0940834 expersq | -.0024117 00082 -2.94 0.003 -.0040192 -. 0008042 married -1082529 .0156894 6.90 0.000 -0774937 -B%9122 union -1824613 0171568 10.63 0.000 «1488253 -2160973 d81 05832 .0303536 1.92 55 ~-0011886 ~ 1178286 482 | 0627744 .0332141. «1.890.059 -.0023421—.1278909 483 0620117 .0366601 1.69 0.091 --0098608 - 1338843 d84 0904672 .0400907 2.26 0.024 011869 - 1690654 d85 -1092463 0433525 2.52 0.012 0242533 - 1942393 486 -1419596 -046423 3.06 0.002 0509469 = 2329723 87 -1738334 049433 3.52 0.000 -0769194 -2707474 —cons 0920558 = .0782701 1.18 0.240 -.0613935 - 2455051 28 Random Effect . xtreg Iwage educ black hisp exper expersq married union d81 d82 d83 d84 d85 d86 d87,re random-effects GLS regression Nunber of obs . 4360 croup variable: ar Number of groups = 345 R-sq: within = 0.1799 ‘obs per group: min = 8 between = 0.1860 avg = 8.0 overall = 0.1830 max = 8 random effects ui ~ Gaussian wald chi2¢14) = 957.77 corr(ui, x) = 0 (assumed) Prob > chi2 = 0.0000 wage coef. std. err. 2 Plz] [95% Conf. rnterval] educ | .0918763 .0106597 8.62 0.000 0709836 -1127689 black | -.1393767 .0477228 = -2.92 0.003 -.2329117 -.0458417 hisp | 20217317 0426063 «= 0.510.610 = -10617751 1052385 exper | 1057545 0153668 «6.880.000 © 0756361 -135 8729 expersq | --0047239 0006895 -6.85 0.000 -.0060753 -.0033726 married 063986 .0167742 3.810.000 = .0311091-0968629 union | 1061344 10178539 5.94 0.000 = 0711415 -1411273 dL 040462 © .0246946 «1.64 0.101 -.0079385 0888626 d82 | 0309212 0323416 = 0.96 0.339 -.0324672 0943096 d83 | 0202806 041582, 0.490.626 = -.0612186 | -1017798 dad | 10431187 0513163 0.840.401 - 10574595 "1436960 d85 | 0578155 0612323 0.94 0.345 = -.0621977 1778286 d36 | 10919476 0712293 1.29 0.197 -10476592 12315544 d37 | .1349289 0813135 1.66 © 0.097 0244427 2943005 cons | 10235864 11506683 «= 0.160.876 271718 13188907 sigmau | .32460315 sigma_e | 35099001 rho | 746100216 (fraction of variance due to u_i) 29 Fixed effect + xtreg Iwage Fixed-effects (within) regression educ black hisp exper expersq married union Number of obs = 4360 Group variable: nar lumber of groups = 545, R-sq: within = 0.1806 Obs per group: min = 8 between = 0.0005 avg = 8.0 overall = 0.0635 max = 8 F(a9, 3905) = 83.85 corr(ui, Xb) = -0.1212 Prob’ > F = 0.0000 wage Coef. Std. Err. t Pith [85% Conf. Interval] educ | (dropped) black | (dropped) hisp | Groped) exper | 1321464 0098247, 13.45 0.000 1128842 .1514087 expersq 0051855 .0007014-7.36 0.000 ~t0038044 married | 10466804 10183104 2.55 0.011 70825796 union | :0800019 0193103 4.14 (0.000 21178614 dsi | ‘lo190448 0203626 «0.940.350 “0589674 82 011322 10202275 0.56 0.576 (0283359 dai] -.0419955 0203205 -2.07 0.039 -20021553 de 0384709 .0203144-1.89 0.058 70013573 85 0432498 0202458 -2.14 0.033 ~-0035562 de 0273819 10203863 -1.34 0.179 10125872 ds7 | (dropped) cons 1.02764 0299499 34.31 0.000 =. 9689201 1.086359 siomau | 4009279 sigma_e | 35099001 rho | 156612236 (Fraction of variance due to u_i) Ftest that all wied: — F(544, 3005) = 7.96 Prob > F = 0.0000 dsi ds2 d83 ds4 ds5 des ds7,fe 30 Fixed effect or random effect 4 Fixed effect estimation allows arbitrary correlation between a, and explanatory variables. Random effect is valid only if a; are uncorrelated with any of the explanatory variables. 4 When you conduct a policy analysis, correlation should be considered as the rule rather than the exception. 4 Thus fixed effect is almost always more convincing than the random effect. 31 4 But if the policy variable is set experimentally, then you might apply random effect. For example, suppose that you want to know the effect of the class size on the students’ achievement. And if students are randomly assigned to classes of different size, then random effect can be applied. 4 However, again, this kind of situation is rare. So, the usual recommendation is to use the fixed effect method. 32

You might also like