Download
chapter 5 panel estimation under n.
Skip this Video
Loading SlideShow in 5 Seconds..
zlyang@smu.sg mysmu/faculty/zlyang/ Zhenlin Yang PowerPoint Presentation
Download Presentation
zlyang@smu.sg mysmu/faculty/zlyang/ Zhenlin Yang

zlyang@smu.sg mysmu/faculty/zlyang/ Zhenlin Yang

834 Views Download Presentation
Download Presentation

zlyang@smu.sg mysmu/faculty/zlyang/ Zhenlin Yang

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Chapter 5: Panel Estimation Under Heteroskedasticity and Serial Correlation This chapter introduces various panel estimation methods that take into account the possible existence of heteroskedasticity and/or serial correlation. The discussions draw on Cameron & Trivedi: Microeconometrics Using Stata 2009. Main methods include: • Cluster-robust estimation for short panels • Pooled OLS estimator or population-averaged estimator • Pooled FGLS estimator or population-averaged estimator • Fixed effects estimators: FE, within, LSDV, First-difference • Random effects estimators: RE, BE • Robust estimation for long panels • Heteroskedasticity and serial correlation • Unit roots and cointegration • Robust estimation for large panels zlyang@smu.edu.sghttp://www.mysmu.edu/faculty/zlyang/Zhenlin Yang

  2. 5.1. Introduction Consider the general panel data model that has been studied: , (5.1) with cross-sections i= 1, , N, and time periods t= 1, , T. Heteroskedasticity refers to that the variance of (or in case of FE models) changes over i or t or both, in particular over i as the cross-sectional units may be of varying size. Serial correlation means that are correlated over time in a way that is more than the equicorrelation induced by the random effects, because it is often that an unobserved shock in one period will affect the behavioral relationship for at least the next few periods. Recall: a short panelhas large Nand small T;a long panelhas small Nand large T, and a large panelhas both N and Tlarge. Depending on the type of panels that the estimation is based upon, the method for handling these two issues are different.

  3. 5.2. Cluster-Robust Estimation for Short Panels For short panels, as T is small it is common to let the time effects be fixed effects. Then Model (5.1) reduces the one-way model: , i= 1, , N, t = 1, , T, (5.2) if the regressors includes a set of time dummies (with one time dummy dropped to avoid the dummy variable trap). Under this parameterization, is , and are subject to . Writing (5.20) in vector form for each i, or the ith cluster, , i = 1, 2, . . ., N, and applying the transformation: , to give , i = 1, 2, . . ., N. (5.3) The cluster-robust VC matrix ofthe Within estimator :

  4. Introduction Assume in (5.3), (i) are independent, and (ii) Var() = , a general T×T positive definite matrix. A robust estimator of the variance-covariance (VC) matrix of the Within estimator is: =, where, and isNT×(K+T1), which stacks . • This is the result given in (3.12), and is valid only for short panels, i.e., the case of large N and small T. • It allows arbitrary correlation among the elements in , for each i, but requires the independence of over i. • Most importantly, the result not only applies to Model (5.3), obtained from one-way FE model after within transformation, it applies to any model of the that form.

  5. Introduction Generalization. Assume in a model of the form , i = 1, 2, . . ., N, (i) are independent, (ii) Var() = , and (iii) . The OLS estimator of is , and a robust estimator of the VC matrix of is: =, (5.4) where, is the stacked , and the stacked . • It can be shown that the OLS estimator is robust against serial-correlation and cross-sectional heteroskedasticity of unknown form; • Clearly, the VC matrix estimate is robust against unknown serial-correlation and cross-sectional heteroskedasticity. • Therefore, and together provide a set of inference methods that are robust against unknown serial-correlation and cross-sectional heteroskedasticity. Various applications of (5.4) are presented.

  6. Introduction Various applications of the result (5.4) are presented. The key Stata command/option for implementing (5.4) is vce(cluster id): • Pooled OLS or population-averaged estimators; • Pooled FGLS or population-averaged estimators; • Within estimation; • Within estimation, allowing time dummies; • Least-squares dummy-variables regression; • First-difference estimation, allowing time dummies; • One-way individual RE estimation, allowing time dummies; • Between estimation; • Comparison of panel estimators based on short panels.

  7. Pooled OLS or Population-Averaged Estimators Pooled OLS estimators simply regress on , using both between (cross-section) and within (time-series) variation in the data, and assuming the disturbances are iid. The resulted OLS estimators of the coefficients of can be consistent if is uncorrelated with , otherwise inconsistent. Even in the case where is consistent, the VC matrix of obtained from an OLS regression may not be correct, as may not be iid, leading to misleading inferences. • To further motivate the OLS estimator and the need for an cluster-robust estimator of it VC matrix, consider Model (5.2): • Consistency of OLS requires that the error term be uncorrelated with . So pooled OLS is consistent if are RE but inconsistent if are FE;Var is not of the form . • In statistical literature, the pooled estimators are called population-averaged (pa) estimators.

  8. Pooled OLS or Population-Averaged Estimators We use the “Returns to Schooling Data” to demonstrate pooled OLS (or PA) with cluster-robust standard errors (CRSD). . * Pooled OLS with cluster-robust standard errors . regress lwageexpexpsqwksed, vce(cluster id) Linear regression Number of obs = 4,165 F(4, 594) = 72.58 Prob > F = 0.0000 R-squared = 0.2836 Root MSE = .39082 (Std. Err. adjusted for 595 clusters in id) ------------------------------------------------------------------------------ | Robust lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- exp | .044675 .0054385 8.21 0.000 .0339941 .055356 expsq | -.0007156 .0001285 -5.57 0.000 -.0009679 -.0004633 wks | .005827 .0019284 3.02 0.003 .0020396 .0096144 ed | .0760407 .0052122 14.59 0.000 .0658042 .0862772 _cons | 4.907961 .1399887 35.06 0.000 4.633028 5.182894 ------------------------------------------------------------------------------ The coefficients estimates are identical to those from xtreg, pa, to be given latter. The standard error are almost same as well.

  9. Pooled OLS or Population-Averaged Estimators • Wages increase with experience until a peak at 31 years [=0.0447/(20.00072)]; • Wages increase by 0.6% with each additional week worked; • And wages increase by 7.6% with each additional year of education. The default standard errors assume that the regression errors are iid: . * Pooled OLS with incorrect default standard errors . regress lwageexpexpsqwksed Source | SS df MS Number of obs = 4,165 -------------+---------------------------------- F(4, 4160) = 411.62 Model | 251.491445 4 62.8728613 Prob > F = 0.0000 Residual | 635.413457 4,160 .152743619 R-squared = 0.2836 -------------+---------------------------------- Adj R-squared = 0.2829 Total | 886.904902 4,164 .212993492 Root MSE = .39082 ------------------------------------------------------------------------------ lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- exp | .044675 .0023929 18.67 0.000 .0399838 .0493663 expsq | -.0007156 .0000528 -13.56 0.000 -.0008191 -.0006121 wks | .005827 .0011827 4.93 0.000 .0035084 .0081456 ed | .0760407 .0022266 34.15 0.000 .0716754 .080406 _cons | 4.907961 .0673297 72.89 0.000 4.775959 5.039963 ------------------------------------------------------------------------------

  10. Pooled OLS or Population-Averaged Estimators • These standard errors are misleadingly small, being .002393, 0.000053, 0.001183, 0.002227, compared with CRSD: 0.0054, 0.0001, 0.0019, 0.0052; • Therefore, it is essential that the OLS standard errors be corrected for clustering on individuals; The pooled OLS estimator can also be obtained using (xtreg, pa) command, with options corr(independent) and vce(robust) nolog: . * Pooled OLS with CRSD using the general xtreg, paprocedure. . xtreglwageexpexpsqwksed, pa corr(independent) vce(robust) nolog … (Std. Err. adjusted for clustering on id) ------------------------------------------------------------------------------ | Robust lwage | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- exp | .044675 .0054358 8.22 0.000 .034021 .0553291 expsq | -.0007156 .0001284 -5.57 0.000 -.0009673 -.000464 wks | .005827 .0019275 3.02 0.003 .0020491 .0096048 ed | .0760407 .0052097 14.60 0.000 .0658299 .0862515 _cons | 4.907961 .1399214 35.08 0.000 4.63372 5.182202 ------------------------------------------------------------------------------

  11. Pooled FGLS or Population-Averaged Estimators Pooled FGLS estimation can lead to estimators of the parameters of the pooled model that are more efficient than OLS estimation. This is achieved by modelling the error correlation matrix of ), assumed constant over I, assumingthat the observations are independent over i and . The pooled estimator, or PA estimator, is obtained using the (xtreg, pa) command, with two key additional options: • corr( ): place different restriction on the error correlation; • vce(robust): to obtain cluster-robust standard errors that are valid even if corr( ) does not specify correct correlation model. • Let be the correlation of the errors at time periods t and s, for individual i. Note the restriction that does not vary with i. Also, corr( )options all set. • There are potentially T(T1) unique off-diagonal values in the error correlation matrix because it need not be that .

  12. Pooled FGLS or Population-Averaged Estimators Typical options for corr( ) include: • corr(independence): sets for . Then the PA estimator equals the pooled OLS estimator; • corr(exchangeable): sets for. Then errors are equicorrelated and (xtreg, pa) is asymptotically equivalent to (xtreg, re). • corr(ark): specifies an autoregressive process of order k, or AR(k), for. • corr(stationary g): specifies a moving average process, or MA(g), for. • corr(unstructured): places no restrictions on . For small T, this may be the best model for correlations over time, but can fail for a larger T. • The nolog option is to prevent the display of an iteration log. In the statistics literature, the PA estimator is also called the generalized estimating equations (GEE) estimator. The (xtreg, pa) command is a special case of xtgee with family(gaussian) option.

  13. Pooled FGLS or Population-Averaged Estimators We demonstrate the applications of the (xtreg, re) command using the “Return to Schooling Data” . * PA or pooled FGLS estimation with AR(2) and cluster-robust standard errors . xtreglwageexpexpsqwksed, pa corr(ar 2) vce(robust) nolog GEE population-averaged model Number of obs = 4,165 Group and time vars: id year Number of groups = 595 Link: identity Obs per group: Family: Gaussian min = 7 Correlation: AR(2) avg = 7.0 max = 7 Wald chi2(4) = 873.28 Scale parameter: .1966639 Prob > chi2 = 0.0000 (Std. Err. adjusted for clustering on id) ------------------------------------------------------------------------------ | Robust lwage | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- exp | .0718915 .003999 17.98 0.000 .0640535 .0797294 expsq | -.0008966 .0000933 -9.61 0.000 -.0010794 -.0007137 wks | .0002964 .0010553 0.28 0.779 -.001772 .0023647 ed | .0905069 .0060161 15.04 0.000 .0787156 .1022982 _cons | 4.526381 .1056897 42.83 0.000 4.319233 4.733529 ------------------------------------------------------------------------------

  14. Pooled FGLS or Population-Averaged Estimators Compared with the results from pooled OLS, we see that • the coefficients change considerably, due to the use of AR(2) model. • the cluster standard errors are smaller than those from the pooled OLS for all regressors except ed, showing the efficacy gain. The estimated error correlation matrix is stored in e(R). We have . * Estimated error correlation matrix after xtreg, pa . matrix list e(R) symmetric e(R)[7,7] c1 c2 c3 c4 c5 c6 c7 r1 1 r2 .89722058 1 r3 .84308581 .89722058 1 r4 .78392846 .84308581 .89722058 1 r5 .73064474 .78392846 .84308581 .89722058 1 r6 .6806209 .73064474 .78392846 .84308581 .89722058 1 r7 .63409777 .6806209 .73064474 .78392846 .84308581 .89722058 1 changes only with the value of |ts|, as ab AR model is used.

  15. Pooled FGLS or Population-Averaged Estimators If an unstructured error correlation matrix is specified, we have . xtreg lwage exp expsq wks south, pa corr(unstructured) vce(robust) nolog ... (Std. Err. adjusted for clustering on id) ------------------------------------------------------------------------------ | Robust lwage | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- exp | .0635066 .0044502 14.27 0.000 .0547845 .0722288 expsq | -.00076 .0001004 -7.57 0.000 -.0009567 -.0005633 wks | .0004141 .0009523 0.43 0.664 -.0014524 .0022805 south | -.0556712 .0516129 -1.08 0.281 -.1568307 .0454883 _cons | 5.810748 .0591324 98.27 0.000 5.694851 5.926645 ------------------------------------------------------------------------------ . matrix list e(R) symmetric e(R)[7,7] c1 c2 c3 c4 c5 c6 c7 r1 1 r2 .91725004 1 r3 .87482529 .85342628 1 r4 .81187266 .81020598 .94111792 1 r5 .74119645 .75303939 .8840834 .91577823 1 r6 .66331271 .68468392 .83678661 .88524751 .91405078 1 r7 .6242693 .65875491 .83721361 .89982964 .93506435 .96584732 1 changes only with the values of t and s, as an unstructured error correlation is specified.

  16. Pooled FGLS or Population-Averaged Estimators . * PA or pooled FGLS estimation with MA(6) and cluster-robust standard errors . xtreglwageexpexpsqwksed, pa corr(stationary 6) vce(robust) nolog GEE population-averaged model Number of obs = 4,165 Group and time vars: id year Number of groups = 595 Link: identity Obs per group: Family: Gaussian min = 7 Correlation: stationary(6) avg = 7.0 max = 7 Wald chi2(4) = 596.42 Scale parameter: .1650487 Prob > chi2 = 0.0000 (Std. Err. adjusted for clustering on id) ------------------------------------------------------------------------------ | Robust lwage | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- exp | .0608033 .0039931 15.23 0.000 .0529769 .0686297 expsq | -.0008603 .0000929 -9.26 0.000 -.0010424 -.0006781 wks | .0005029 .0010016 0.50 0.616 -.0014602 .002466 ed | .07985 .0053356 14.97 0.000 .0693923 .0903076 _cons | 4.846687 .097278 49.82 0.000 4.656026 5.037349 ------------------------------------------------------------------------------ The results are similar to those based on AR(2).

  17. Time Series Autocorrelation for Panel Data Some Stata commands are useful in analyzing the correlation of errors over time. First, set both panel and time identifies by xtset. • L1.lwage or L.lwage: for lwage lagged once; • L2.lwage: for lwage lagged twice; • D.lwage: for the first difference in lwage (equals lwage L.lwage); • LD.lwage: for the difference lagged once; • L2D.lwage: for the difference lagged twice. . correlate lwage L1.lwage L2.lwage L3.lwage L4.lwage L5.lwage L6.lwage (obs=595) | L. L2. L3. L4. L5. L6. | lwagelwagelwagelwagelwagelwagelwage -------------+--------------------------------------------------------------- lwage | --. | 1.0000 L1. | 0.9238 1.0000 L2. | 0.9083 0.9271 1.0000 L3. | 0.8753 0.8843 0.9067 1.0000 L4. | 0.8471 0.8551 0.8833 0.8990 1.0000 L5. | 0.8261 0.8347 0.8721 0.8641 0.8667 1.0000 L6. | 0.8033 0.8163 0.8518 0.8465 0.8594 0.9418 1.0000 Correlation changes only with the values of t and s.

  18. Within Estimator with Cluster-Robust SE The within (of FE) estimator of a one-way FE model is obtained by running an OLS regression on the within-transformed model (5.3), or an OLS regression of the within equation: The (xtreg, fe) command computes this estimator assuming are iid. The vce(robust) option relaxes this assumption and provides cluster-robust standard errors, provided that the observations are independent over i and . • The FE or within estimator controls for the fixed effects , by using the within i differences so that are differenced out; • However, the within estimation method is unable to estimate the coefficients of time-invariant regressors, and • The within estimator will be relatively imprecise for time-varying regressors that vary little over time. • Further, the within estimation will be relatively less efficient as a result of losing one period of data due to differencing.

  19. Within Estimator with Cluster-Robust SE . xtreglwageexpexpsqwks, fevce(cluster id) Fixed-effects (within) regression Number of obs = 4,165 Group variable: id Number of groups = 595 R-sq: Obs per group: within = 0.6566 min = 7 between = 0.0276 avg = 7.0 overall = 0.0476 max = 7 F(3,594) = 1059.72 corr(u_i, Xb) = -0.9107 Prob > F = 0.0000 (Std. Err. adjusted for 595 clusters in id) ------------------------------------------------------------------------------ | Robust lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- exp | .1137879 .0040289 28.24 0.000 .1058753 .1217004 expsq | -.0004244 .0000822 -5.16 0.000 -.0005858 -.0002629 wks | .0008359 .0008697 0.96 0.337 -.0008721 .0025439 _cons | 4.596396 .0600887 76.49 0.000 4.478384 4.714408 -------------+---------------------------------------------------------------- sigma_u | 1.0362039 sigma_e | .15220316 rho | .97888036 (fraction of variance due to u_i) ------------------------------------------------------------------------------ Compared with pooled OLS, the standard errors have increased. The ed variable cannot be included.

  20. Within Estimator with CRSE and Time Dummies . xtreglwageexpexpsqwksi.year, fevce(cluster id) note: 7.year omitted because of collinearity Fixed-effects (within) regression Number of obs = 4,165 Group variable: id Number of groups = 595 R-sq: Obs per group: within = 0.6599 min = 7 between = 0.0275 avg = 7.0 overall = 0.0480 max = 7 F(8,594) = 412.33 corr(u_i, Xb) = -0.9089 Prob > F = 0.0000 (Std. Err. adjusted for 595 clusters in id) ------------------------------------------------------------------------------ | Robust lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- exp | .1119927 .0041184 27.19 0.000 .1039043 .1200812 expsq | -.0004051 .0000834 -4.86 0.000 -.0005688 -.0002413 wks | .00068 .0008812 0.77 0.441 -.0010506 .0024105

  21. Within Estimator with CRSE and Time Dummies Cont’d year | 2 | -.0083984 .0049321 -1.70 0.089 -.0180849 .0012881 3 | .0259652 .0084359 3.08 0.002 .0093974 .0425329 4 | .0289134 .0078093 3.70 0.000 .0135762 .0442506 5 | .0239406 .0065275 3.67 0.000 .0111208 .0367604 6 | .0069955 .0064617 1.08 0.279 -.0056949 .019686 7 | 0 (omitted) | _cons | 4.618339 .0599451 77.04 0.000 4.500609 4.736069 -------------+---------------------------------------------------------------- sigma_u | 1.0268811 sigma_e | .15159041 rho | .97867247 (fraction of variance due to u_i) ------------------------------------------------------------------------------

  22. Least-Squares Dummy-Variables Regression The within estimator of can be shown to equal the estimator obtained from a direct OLS estimation of and in individual effects model , using command areg: . areglwageexpexpsqwks, absorb(id) vce(cluster id) Linear regression, absorbing indicators Number of obs = 4,165 F( 3, 594) = 908.44 Prob > F = 0.0000 R-squared = 0.9068 Adj R-squared = 0.8912 Root MSE = 0.1522 (Std. Err. adjusted for 595 clusters in id) ------------------------------------------------------------------------------ | Robust lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- exp | .1137879 .0043514 26.15 0.000 .1052418 .1223339 expsq | -.0004244 .0000888 -4.78 0.000 -.0005988 -.00025 wks | .0008359 .0009393 0.89 0.374 -.0010089 .0026806 _cons | 4.596396 .0648993 70.82 0.000 4.468936 4.723856 -------------+---------------------------------------------------------------- id | absorbed (595 categories) The coefficients estimates are the same as those from xtreg, fe. The robust standard errors differ and are invalid as areg is designed for long panels.

  23. First-Difference Estimator Consistent estimation of in one-way FE model requires elimination of which is achieved by the within transformation to give the within estimator. An orthogonal transformation method was introduced in Chapter 2. Another way to do so is through the first difference: where the time-invariant are eliminated through differencing. An OLS estimation of this model yields consistent estimates of . • The FD operator is not provided as an option to xtreg. Instead, the estimator can be computed using regress and Stata time-series operators D. to compute the first difference. • Similar to the within estimator, the time dummies, fixed time effects, can be added to the model. • The robust standard errors can be calculated using vce(cluster id), valid when observations are independent over i and .

  24. First-Difference Estimator . regress D.(lwageexpexpsqwksed), vce(cluster id) noconstant note: D.ed omitted because of collinearity Linear regression Number of obs = 3,570 F(3, 594) = 1035.19 Prob > F = 0.0000 R-squared = 0.2209 Root MSE = .18156 (Std. Err. adjusted for 595 clusters in id) ------------------------------------------------------------------------------ | Robust D.lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- exp | D1. | .1170654 .0040974 28.57 0.000 .1090182 .1251126 expsq | D1. | -.0005321 .0000808 -6.58 0.000 -.0006908 -.0003734 wks | D1. | -.0002683 .0011783 -0.23 0.820 -.0025824 .0020459 ed | D1. | 0 (omitted) ------------------------------------------------------------------------------

  25. One-Way Random Effects Estimator with CRSE Recall the one-way random effects model given Ch. 2: , i= 1, , N and t= 1, , T. The default of (xtreg, re) command returns RE estimator of this model under ~ IID(0, ) and ~ IID(0, ), independent of each other, and is independent of and for all i and t. • For the disturbances, it is easy to see that , for all . • RE model has equicorrelated/exchangeable errors, which is realized by Stata command xtregwith option re. • The options mle or pacorr(exchangeable) give asymptotically equivalent estimators, with different estimators of and . • The robust standard errors can be calculated using vce(cluster id), valid when observations are independent over i and .

  26. One-Way Random Effects Estimator with CRSE . xtreglwageexpexpsqwksed, re vce(cluster id) theta Random-effects GLS regression Number of obs = 4,165 Group variable: id Number of groups = 595 R-sq: Obs per group: within = 0.6340 min = 7 between = 0.1716 avg = 7.0 overall = 0.1830 max = 7 Wald chi2(4) = 1598.50 corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0000 theta = .82280511 (Std. Err. adjusted for 595 clusters in id) ------------------------------------------------------------------------------ | Robust lwage | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- exp | .0888609 .0039992 22.22 0.000 .0810227 .0966992 expsq | -.0007726 .0000896 -8.62 0.000 -.0009481 -.000597 wks | .0009658 .0009259 1.04 0.297 -.000849 .0027806 ed | .1117099 .0083954 13.31 0.000 .0952552 .1281647 _cons | 3.829366 .1333931 28.71 0.000 3.567921 4.090812 -------------+---------------------------------------------------------------- sigma_u | .31951859 sigma_e | .15220316 rho | .81505521 (fraction of variance due to u_i) ------------------------------------------------------------------------------

  27. Between Estimator with CRSE The between estimator is the OLS estimator of the between model: Consistency of the OLS estimator requires that the ‘disturbance’ term is uncorrelated with . This is the case if is a random effect but not if is a fixed effect. • The between estimator is obtained by specifying the be option of the xtreg command. This essentially a cross-section regression. • Therefore, the cross-sectional heteroskedasticity is the issue of concern. There is no explicit option of heteroskedasticity-robust standard errors, except the vce(bootstrap) option. • The between estimator is based on averages over t, , i.e., based on the between i variations. Hence it is less efficient than the other estimators such as RE, MLE.

  28. Between Estimator with CRSE . xtreglwageexpexpsqwksed, be Between regression (regression on group means) Number of obs = 4,165 Group variable: id Number of groups = 595 R-sq: Obs per group: within = 0.1357 min = 7 between = 0.3264 avg = 7.0 overall = 0.2723 max = 7 F(4,590) = 71.48 sd(u_i + avg(e_i.))= .324656 Prob > F = 0.0000 ------------------------------------------------------------------------------ lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- exp | .038153 .0056967 6.70 0.000 .0269647 .0493412 expsq | -.0006313 .0001257 -5.02 0.000 -.0008781 -.0003844 wks | .0130903 .0040659 3.22 0.001 .0051048 .0210757 ed | .0737838 .0048985 15.06 0.000 .0641632 .0834044 _cons | 4.683039 .2100989 22.29 0.000 4.270407 5.095672 ------------------------------------------------------------------------------

  29. Between Estimator with CRSE . xtreglwageexpexpsqwksed, be vce(bootstrap) (running xtreg on estimation sample) Bootstrap replications (50) ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 .................................................. 50 Between regression (regression on group means) Number of obs = 4,165 Group variable: id Number of groups = 595 … (Replications based on 595 clusters in id) ------------------------------------------------------------------------------ | Observed Bootstrap Normal-based lwage | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- exp | .038153 .0056931 6.70 0.000 .0269946 .0493113 expsq | -.0006313 .0001292 -4.89 0.000 -.0008845 -.0003781 wks | .0130903 .0035953 3.64 0.000 .0060437 .0201369 ed | .0737838 .005292 13.94 0.000 .0634116 .084156 _cons | 4.683039 .2019226 23.19 0.000 4.287278 5.0788 ------------------------------------------------------------------------------

  30. Comparison of Panel Estimators based on Short Panels Recall from Chap 3 the three measures reported in Stata: Within : Between : Overall : where denotes the squared correlation between x and y, and is obtained from one of the xtreg options (be, fe, or re). Also, Stata reports: sigma_u:gives the standard deviation of individual effects sigma_e: gives the standard deviation of idiosyncratic error rho: the fraction of variance due to, i.e., In RE estimation, there is an theta option: For pooled OLS estimation: ; For within estimation: ; For RE, as T, get large.

  31. Comparison of Panel Estimators based on Short Panels We compare some of the panel estimators and the associated standard errors, variance components estimates, and R2. Note: pooled OLS is the same as xtreg command with the corr(independence) and pa options. The Stata commands are: * Compare OLS, BE, FE, RE estimators, and methods to compare standard errors global xlistexpexpsqwksed quietly regress lwage $xlist, vce(cluster id) estimates store OLS_rob quietly xtreglwage $xlist, be estimates store BE quietly xtreg lwage $xlist, fe estimates store FE quietly xtreg lwage $xlist, fevce(robust) estimates store FE_rob quietly xtreg lwage $xlist, re estimates store RE quietly xtreg lwage $xlist, re vce(robust) estimates store RE_rob estimates table OLS_rob BE FE FE_rob RE RE_rob, > b se stats(N r2 r2_o r2_b r2_w sigma_usigma_e rho) b(%7.4f)

  32. Comparison of Panel Estimators based on Short Panels ------------------------------------------------------------------------------- Variable | OLS_rob BE FE FE_rob RE RE_rob --------+---------------------------------------------------------------------- exp | 0.0447 0.0382 0.1138 0.1138 0.0889 0.0889 | 0.0054 0.0057 0.0025 0.0040 0.0028 0.0040 expsq | -0.0007 -0.0006 -0.0004 -0.0004 -0.0008 -0.0008 | 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 wks | 0.0058 0.0131 0.0008 0.0008 0.0010 0.0010 | 0.0019 0.0041 0.0006 0.0009 0.0007 0.0009 ed | 0.0760 0.0738 (omitted) (omitted) 0.1117 0.1117 | 0.0052 0.0049 0.0061 0.0084 _cons | 4.9080 4.6830 4.5964 4.5964 3.8294 3.8294 | 0.1400 0.2101 0.0389 0.0601 0.0936 0.1334 --------+---------------------------------------------------------------------- N | 4165 4165 4165 4165 4165 4165 r2 | 0.2836 0.3264 0.6566 0.6566 r2_o | 0.2723 0.0476 0.0476 0.1830 0.1830 r2_b | 0.3264 0.0276 0.0276 0.1716 0.1716 r2_w | 0.1357 0.6566 0.6566 0.6340 0.6340 sigma_u| 1.0362 1.0362 0.3195 0.3195 sigma_e| 0.1522 0.1522 0.1522 0.1522 rho | 0.9789 0.9789 0.8151 0.8151 -------------------------------------------------------------------------------

  33. 5.2. Robust Estimation for Long Panels The methods considered up to now have focused on short panels. Now we consider long panels with many time periods for relatively few individuals (N is small and T is large). • The individual fixed effects, if desired, can be easily handled by including dummy variables for each individual as regressors. • With long panels (), there is an issue of stationarity. Here we consider only methods for stationary errors, with the cases of unit roots and cointegration being briefly mentioned. • When T is large, one cannot have cluster-robust standard errors (as in short panel case). Instead, it is necessary to specify a model for serial correlation in the error. • Typical Stata commands for analyzing long panels include: xtregr, xtpcse, xtgls, xtscc, and the respective options. • We will use the well-known cigarette demand data for illustrations.

  34. Cigarette Demand Data • Recall the cigarette demand data introduced in Chap. 1: a panel of 46 states in United States over 30 years (1963-1992), given on the Wiley website for Baltagi (2005): https://www.wiley.com/legacy/wileychi/baltagi3e/. • Variables in the data file Cigar.txt are: • (1) STATE = State abbreviation. • (2) YR = YEAR. • (3) Price per pack of cigarettes. • (4) Population. • (5) Population above the age of 16. • (6) CPI = Consumer price index with (1983=100) • (7) NDI = Per capita disposable income. • (8) C = Cigarette sales in packs per capita. • (9) PIMIN = Minimum price in adjoining states per pack of cigarettes. • Several time dummies corresponding to the major policy interventions in 1965, 1968 and 1971 can be added into the model. • To reflect long panel nature, we choose only first 10 states.

  35. Serial Correlation & Heteroskedasticity in Long Panels Consider the one-way effects model: , i= 1, , N, t = 1, , T. As now N is small, the individual effects can be merged into in the form of dummies, so that the model is reduced to: , i = 1, , N, t = 1, , T. (5.5) where the regressors include intercept, and may also include individual dummies, and time and possibly time-squared, giving a model like a regular multiple linear regression model. • The focal point for a long panel is the serial correlation of over t. A model has to be specified as T is large. • As N is small, one can be more flexible on the cross-sectional relations: heteroskedasticity and cross-section correlation.

  36. Serial Correlation & Heteroskedasticity in Long Panels A simple way to model serial correlation is to allow for first-order autoregressive disturbances, i.e., AR(1), for (5.5): , i = 1, , N, t = 1, , T. where the autoregressive parameter may vary with i, with || < 1. Also, the remainder errors are assumed to be normal with mean zero and a general VC matrix that allows for possible heteroskedasticity and cross-sectional correlation: E, where where is with elements . Two special cases are of interest: • is diagonal (i.e., for ), only heteroskedasticity. • is diagonal and further, all of the are equal to . Under exogeneity of in (5.5), the OLS is unbiased and consistent.

  37. Serial Correlation & Heteroskedasticity in Long Panels . xtglsLnCLnPLnNDILnPmin Year, panels(correlated) corr(psar1) Cross-sectional time-series FGLS regression Coefficients: generalized least squares Panels: heteroskedastic with cross-sectional correlation Correlation: panel-specific AR(1) Estimated covariances = 55 Number of obs = 300 Estimated autocorrelations = 10 Number of groups = 10 Estimated coefficients = 5 Time periods = 30 Wald chi2(4) = 415.15 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ LnC | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- LnP | -.3582815 .0218597 -16.39 0.000 -.4011258 -.3154373 LnNDI | .5221231 .0573434 9.11 0.000 .4097321 .634514 LnPmin | -.019819 .0289541 -0.68 0.494 -.0765681 .03693 Year | -.0273553 .0052343 -5.23 0.000 -.0376144 -.0170961 _cons | 3.847968 .2192518 17.55 0.000 3.418242 4.277693 ------------------------------------------------------------------------------

  38. Serial Correlation & Heteroskedasticity in Long Panels where the xtset command is first executed before running xtgls: . xtset State Year panel variable: State (strongly balanced) time variable: Year, 63 to 92 delta: 1 unit • All regressors have the expected effects. • The estimated price elasticity of demand for cigarette is .3583, • The income elasticity is.5521, • Demand declines by2.7% per year (the coefficient of Year is semielasticity as because the dependent variable is in logs), • The minimum price in the adjoining states does not have a significant effect on the demand in the current state. There are 10 states, so there 1011/2 = 55 unique entries in the 1010 contemporaneous error covariance matrix , and 10 autocorrelation parameters are estimated!

  39. Serial Correlation & Heteroskedasticity in Long Panels • The xtgls command does the pooled OLS or FGLS estimation when data are from a long panel. They allow the errors in the model to be correlated over i, allow the use of AR(1) models for over t, and allow to be heteroskedastic. • An alternative Stata command, xtpcse, yields (long) panel-corrected standard errors (pcse) for the pooled OLS estimator, as well as for pooled least-squares estimator with an AR(1) model for . • A third choice, xtscc, generalizes xtpcse by allowing AR(m) errors. It gives Driscoll and Kraay(1998) standard errors for coefficients estimated by pooled OLS/WLS or fixed-effects (within) regression. • Note: the xtscc is not automatically installed with the installation of Stata. It can be found and installed by following the steps: • Goto help > search; type xtscc • In the pumped up window, click the link xtsccfrom http://fmwww.bc.edu/RePEc/bocode/x • And then click on: “click here to install”.

  40. Serial Correlation & Heteroskedasticity in Long Panels Options for xtpcse: correlation() with choices: • hetonly: are independence but heteroskedastic over i; • independence: are iid; • ar1: constant ; and • psar1: different . In all cases, panel corrected standard errors that allow heteroskedasticity and correlation over i are reported. Options for xtgls: • panels(): specifies the error correlation across individuals: • iid: are iid; • heteroskedastic: are independence i, with variance • correlated: additionally allows correlation over individuals, with independence over time for given individual. • corr( ): specifies serial correlation of errors for each individual: • ar1: constant ; and • psar1: different .

  41. Serial Correlation & Heteroskedasticity in Long Panels Options for xtscc:. • lag(#): set maximum lag order of autocorrelation; default is • m(T)=floor[4(T/100)^(2/9)]; • fe: perform fixed effects (within) regression; • re: perform GLS random effects regression • pooled: perform pooled OLS/WLS regression; default • noconstant: suppress regression constant in pooled OLS/WLS regressions • ase: return (asymptotic) Driscoll-Kraay SE without small sample adjustment

  42. Serial Correlation & Heteroskedasticity in Long Panels We now use xtpcse, xtgls and user written xtscc (needs separate installation) to obtain the following pooled estimators and the associated standard errors: 1) pooled OLS with iid errors; 2) pooled OLS with standard errors assuming correlation over states; 3) pooled OLS assuming general serial correlation in the error (4 lags) and correlation over states; 4) pooled OLS that assumes an AR(1) error and gets standard errors that additionally permits correlation over states; 5) pooled FGLS with standard errors assuming an AR(1) error; and 6) pooled FGLS assuming an AR(1) error and correlation across states. . . * Comparison of various pooled OLS and GLS estimators . quietly xtpcseLnCLnPLnNDILnPmin Year, corr(ind) independent nmk . estimates store OLS_iid . quietly xtpcseLnCLnPLnNDILnPmin Year, corr(ind) . estimates store OLS_cor . quietly xtsccLnCLnPLnNDILnPmin Year, lag(4) . estimates store OLS_DK . quietly xtpcseLnCLnPLnNDILnPmin Year, corr(ar1) . estimates store AR1_cor . quietly xtglsLnCLnPLnNDILnPmin Year, corr(ar1)panels(iid) . estimates store FGLSAR1 . quietly xtglsLnCLnPLnNDILnPmin Year, corr(ar1) panels(correlated) . estimates store FGLSCAR

  43. Serial Correlation & Heteroskedasticity in Long Panels . estimates table OLS_iidOLS_cor OLS_DK AR1_cor FGLSAR1 FGLSCAR, b(%7.3f) se -------------------------------------------------------------------------- Variable | OLS_iidOLS_cor OLS_DK AR1_cor FGLSAR1 FGLSCAR -------------+------------------------------------------------------------ LnP | -0.786 -0.786 -0.786 -0.311 -0.308 -0.360 | 0.130 0.172 0.262 0.050 0.049 0.026 LnNDI | 0.412 0.412 0.412 0.458 0.460 0.490 | 0.047 0.075 0.154 0.118 0.088 0.077 LnPmin | -0.049 -0.049 -0.049 -0.003 -0.001 -0.009 | 0.123 0.157 0.243 0.067 0.060 0.034 Year | 0.015 0.015 0.015 -0.024 -0.024 -0.023 | 0.007 0.006 0.012 0.011 0.008 0.007 _cons | 3.469 3.469 3.469 3.930 3.931 3.778 | 0.174 0.245 0.462 0.418 0.310 0.302 -------------------------------------------------------------------------- legend: b/se For pooled OLS with iid errors, the nmk option normalizes the VCE by Nk rather than N, so that the output is exactly the same as that from regress with default standard errors. The same could be obtained by using xtgls with the corr(ind) panel(iid) nmk options

  44. Serial Correlation & Heteroskedasticity in Long Panels An final illustration is the xtscc with fe option. The default is re. . xtsccLnCLnPLnNDILnPmin Year, fe lag(4) Regression with Driscoll-Kraay standard errors Number of obs = 300 Method: Fixed-effects regression Number of groups = 10 Group variable (i): State F( 4, 29) = 117.61 maximum lag: 4 Prob > F = 0.0000 within R-squared = 0.6392 ------------------------------------------------------------------------------ | Drisc/Kraay LnC | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- LnP | -1.238273 .1367816 -9.05 0.000 -1.518023 -.9585236 LnNDI | .7553486 .1595965 4.73 0.000 .4289371 1.08176 LnPmin | .4683234 .1679333 2.79 0.009 .1248613 .8117856 Year | -.0152654 .0126641 -1.21 0.238 -.0411663 .0106355 _cons | 2.562785 .463528 5.53 0.000 1.614764 3.510806 ------------------------------------------------------------------------------ Compared with the results from xtsccLnCLnPLnNDILnPmin Year, lag(4), we see that LnPmin becomes significant.

  45. Unit Roots and Cointegration The methods for long panel considered depend on the stationarity of the time series, i.e., , i = 1, …, N. The literature on panel methods for unit roots and cointegration is large, andit remains to be an active area of research. In standard application of long panel methods, it is of interest to test the existence unit roots and cointegration. Panel unit-root tests: The Stata command xtunitroot (https://www.stata.com/features/overview/panel-data-unit-root-tests/) provides tests appropriate for all types of panel data: short, long, or large panel. A detailed treatments on these tests are beyond the course. Panel cointegration tests: The Stata commandxtcointtest(https://www.stata.com/new-in-stata/panel-data-cointegration-tests/) implements a variety of tests for panel data with large-Nlarge-T. This seems to be an added feature for Stata 15. Again, a detained treatment on this topic is beyond the course.

  46. 5.3. Robust Estimation for Large Panels Consider the one-way effects model: , i= 1, , N, t = 1, , T, where both N and T are ‘large’. • The xtreg works for large panel under iid assumptions on . • An alternative and better procedure, xtregar, allows AR(1) error . . * Comparison of various RE and FE estimators with full cigarette demand data . quietly xtsccLnCLnPLnNDILnPmin, lag(4) . estimates store OLS_DK . quietly xtregLnCLnPLnNDILnPmin, fe . estimates store FE_REG . quietly xtregLnCLnPLnNDILnPmin, re . estimates store RE_REG . quietly xtregarLnCLnPLnNDILnPmin, fe . estimates store FE_REGAR . quietly xtregarLnCLnPLnNDILnPmin, re . estimates store RE_REGAR . quietly xtsccLnCLnPLnNDILnPmin, fe lag(4) . estimates store FE_DK

  47. Robust Estimation for Large Panels . estimates table OLS_DK FE_REG RE_REG FE_REGAR RE_REGAR FE_DK, b(%7.3f) se -------------------------------------------------------------------------- Variable | OLS_DK FE_REG RE_REG FE_RE~R RE_RE~R FE_DK -------------+------------------------------------------------------------ LnP | -1.107 -0.886 -0.889 -0.388 -0.413 -0.886 | 0.049 0.037 0.037 0.024 0.024 0.072 LnNDI | 0.569 0.512 0.512 0.213 0.250 0.512 | 0.048 0.014 0.014 0.026 0.019 0.031 LnPmin | 0.358 0.207 0.210 0.017 0.016 0.207 | 0.049 0.037 0.037 0.026 0.026 0.067 _cons | 2.908 3.111 3.108 4.452 4.221 3.111 | 0.208 0.060 0.064 0.017 0.099 0.137 -------------------------------------------------------------------------- legend: b/se It is indeed that xtregar gives more efficient estimators than does the xtreg. The last set of results from “xtsccLnCLnPLnNDILnPmin, fe lag(4)” are the standard within estimators but with standard errors are robust to both spatial and temporal correlation of the error. However, the standard errors produced by xtscc are much larger, … .