Thanks to Prof. Kit Baum, xtgls2 package are now available on SSC. You can install them from SSC by entering the following command into Stata:
xtgls2 helps STATA users estimate General GLS for Pooled, Fixed-effects, First-differences models, as described in Kiefer (1980) and Wooldridge (2002, 2010).
In which, the error covariance matrix has an arbitrary form within panels (allowing for heteroskedasticity over time periods and arbitrary serial correlations) and this structure is identical across panels.
It is possible to relax these assumptions, i.e. to allow for heteroskedasticity across panels, by using Arellano (1987) standard errors. xtgls2 does this using the cluster(varname) option with varname = panel variables.
For any comments about the command, please send to [email protected]
Examples:
Code:
ssc install xtgls2
In which, the error covariance matrix has an arbitrary form within panels (allowing for heteroskedasticity over time periods and arbitrary serial correlations) and this structure is identical across panels.
It is possible to relax these assumptions, i.e. to allow for heteroskedasticity across panels, by using Arellano (1987) standard errors. xtgls2 does this using the cluster(varname) option with varname = panel variables.
For any comments about the command, please send to [email protected]
Examples:
Code:
. webuse abdata, clear . xtbalance, range(1980 1984) (498 observations deleted due to out of range) (358 observations deleted due to discontinues) . xtgls2 n l(1/2).w c.(k ys)##c.(k ys) i.ind i.year, c(c) fd nocons cl(id) igls nolo Convergenced after 30 iterations First-difference Generalized Least Squares (FDGLS) regression Error covariance structure Time series: Heteroskedasticity and serial correlation Cross-section: Homoskedasticity Estimated covariances: 3 Number of obs = 70 R-squared: Number of groups = 35 Within = 0.0096 Time periods = 2 Between = 0.0004 Wald chi2(9) = 91.594 Overall = 0.0004 Prob > chi2 = 0.0000 (Std. err. adjusted for 35 clusters in id) ------------------------------------------------------------------------------ | Robust n | Coefficient std. err. z P>|z| [95% conf. interval] -------------+---------------------------------------------------------------- w | L1. | .4604677 .1173617 3.92 0.000 .230443 .6904925 L2. | .1945558 .2115014 0.92 0.358 -.2199794 .609091 | k | 2.538793 1.366328 1.86 0.063 -.1391604 5.216747 ys | -28.17702 30.72851 -0.92 0.359 -88.40379 32.04975 | c.k#c.k | -.103131 .0643289 -1.60 0.109 -.2292133 .0229513 | c.k#c.ys | -.4682237 .2880477 -1.63 0.104 -1.032787 .0963393 | c.ys#c.ys | 2.904299 3.291465 0.88 0.378 -3.546854 9.355452 | year | 1982 | -.0318849 .0522636 -0.61 0.542 -.1343197 .0705499 1983 | -.0247939 .0231626 -1.07 0.284 -.0701917 .020604 ------------------------------------------------------------------------------
Comment