Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • XTGLS2 - Estimate General GLS for Pooled, Fixed-effects and First-difference models in large N, small T panel data

    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:
    Code:
    ssc install xtgls2
    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:
    . 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
    ------------------------------------------------------------------------------

  • #2
    This looks like a command I’ve been waiting for! I’d prefer the syntax for the choice of variance estimator to be vce(robust) as well as vce(cluster cid). In the former case, inference is robust to what I call “system heteroskedasticity,” which arises from estimating a constant T x T variance covariance matrix that’s not also the conditional var-cov matrix. That’s a separate issue from clustering. Hopefully the current command does what I want if you use cluster(id) where id is the panel id.

    Comment


    • #3
      Originally posted by Jeff Wooldridge View Post
      This looks like a command I’ve been waiting for! I’d prefer the syntax for the choice of variance estimator to be vce(robust) as well as vce(cluster cid). In the former case, inference is robust to what I call “system heteroskedasticity,” which arises from estimating a constant T x T variance covariance matrix that’s not also the conditional var-cov matrix. That’s a separate issue from clustering. Hopefully the current command does what I want if you use cluster(id) where id is the panel id.
      Hi prof. Jeffrey Wooldridge,

      xtgls2 with the cluster(panel_var) option does indeed compute standard errors that are robust to “system heteroskedasticity”, as you prefer.

      Specifically, the formula for computing robust standard errors can be found in Wooldridge (2010):
      • Pooled GLS: formula (7.52) on page 172
      • FEGLS: formula in chapter 10, on page 314
      • FDGSL: similar to FEGLS and PGLS but with first-different transformed data.
      The Pooled GLS estimation results with robust standard errors from xtgls2 can be compared with the corresponding output from EViews, with the declaration GLS weights = Period SUR and Covariance method = White period (no d.f. correction).

      Thank you so much and wish you a good day.

      Comment


      • #4
        Update for xtgls2 and xttest4 command

        xttest4 performs Kézdi (2003) test for heteroskedasticity in fixed effects models.
        Version 1.3 for xtgls2 can be installed by downloading the .ado and .sthlp files attached to this comment.

        The latest versions of these commands can be found at my github address: ManhHB94 (Manh Hoang Ba)

        Any comments are welcome.
        Attached Files

        Comment

        Working...
        X