Announcement

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

  • xtreg re vs xtgls

    For our regressions we currently in essence use:

    Code:
    xtreg esg returncomeqy `controls', i(id) re robust
    For which Stata outputs:
    Code:
    Random-effects GLS regression                   Number of obs     =      1,794
    Group variable: id                              Number of groups  =         92
    Here it says Random-effects GLS. According to a hausman test we should use random effects.

    However, then there is the command xtgls available. What is the difference between xtreg re and xtgls? How do we know which one to use?

    A related problem we have is to get R^2-values outputted with outreg2 for our panel data regressions -- maybe this is somehow related.
    Last edited by Frans Englich; 16 Apr 2020, 10:53.

  • #2
    Frans:
    labelling N the cross-sectional dimension and T the time series dimension of a given panel dataset:
    if N>T (short panel): go -xtreg-;
    if T>N (long panel): go -xtgls- (but you may want to consider -xtregar-, too).
    Unfortunately I cannot help you out about the question concerning the community-contributed -outreg2- command.
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Thanks Carlo. Two follow-up questions:
      1. What is the difference between thes two different techniques? Is it about statistical efficiency or maybe even consistency?
      2. Hence, where is this heuristic and related documented, what is a reference?

      Comment


      • #4
        Frans:
        1) -xtgls- and -xtregar- support autocorrelation modelling, whereas -xtreg- does not;
        2) you can find some interesting references in their entries in Stata.pdf manual.
        Kind regards,
        Carlo
        (StataNow 18.5)

        Comment


        • #5
          To add to Carlo's helpful comment, this is a problem I have been worrying about recently. There is another issue – I don't think xtgls includes fixed or random effects so it is running a very different model than xtreg or xtregar.

          Comment


          • #6
            Carlo: if I follow the heuristic you posted in comment #2, I should use GLS for all regressions. However, when I run the xtgls regression it says "estimated autocorrelations = 0", which suggests that there is no need for GLS, or have I misunderstood? Should I revert back to xtreg fe/re?

            Also, why isn't R^2 reported? I cannot find it in xtgls' output nor -ereturn list-. Maybe I've misunderstood something fundamental here.

            Comment


            • #7
              Frans:
              1) please post what you typed and what Stata gave you back via CODE delimiters. Thanks.
              2) under -ereturn list -xtgls- returns chi2 instead of R-sq.
              Kind regards,
              Carlo
              (StataNow 18.5)

              Comment


              • #8
                For:
                Code:
                xtgls esg totmktval `controls', i(id)
                I get:
                Code:
                [...]
                note: g_industry51 omitted because of collinearity
                
                Cross-sectional time-series FGLS regression
                
                Coefficients:  generalized least squares
                Panels:        homoskedastic
                Correlation:   no autocorrelation
                
                Estimated covariances      =         1          Number of obs     =      6,086
                Estimated autocorrelations =         0          Number of groups  =         98
                Estimated coefficients     =        53          Obs per group:
                                                                              min =          3
                                                                              avg =   62.10204
                                                                              max =        192
                                                                Wald chi2(52)     =    4807.20
                Log likelihood             = -19167.98          Prob > chi2       =     0.0000
                -------------------------------------------------------------------------------------
                                esg |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                --------------------+----------------------------------------------------------------
                          totmktval |    .000025   2.09e-06    11.96   0.000     .0000209    .0000291
                 g_economic_sector1 |  -14.04434   .8560237   -16.41   0.000    -15.72212   -12.36657
                [...]
                I need a somewhat general understanding; for instance, the hausman test returns different conclusions for different regressions, so it might be that whether to use xtgls or xtreg will differ for the different regressions, as well.
                Last edited by Frans Englich; 23 Apr 2020, 09:31.

                Comment


                • #9
                  Frans:
                  for your panel I would recommend -xtgls-, not -xtreg-.
                  The -hausman- test outcome points you to -fe- or -re- specification, without explicitly considering the N and T dimension.
                  Kind regards,
                  Carlo
                  (StataNow 18.5)

                  Comment


                  • #10
                    What advantage does GLS bring in this case? You say that "-xtgls- and -xtregar- support autocorrelation modelling", and we see in the output in comment #8 that "Correlation: no autocorrelation". Hence, what does GLS achieve here, since there is no autocorrelation to address? Thank you for all your aid, it's immensely helpful.

                    Comment


                    • #11
                      Frans:
                      the commands you mention differ fro some options, too.
                      For instance, -xtregar- does not allow dealing with heteroskedasticity and limits autocorrelation modelling at AR1 process.
                      Conversely, -xtgls- is basically a random effect estimator (with no explicit option for -fe-), but allows dealing with heteroskedasticity with bot correlated and uncorrelated error structure, as well as across panels correlation..
                      Imposing the default option -corr(independent)- in -xtgls- is a researcher's decision, not a command constraint.
                      Kind regards,
                      Carlo
                      (StataNow 18.5)

                      Comment


                      • #12
                        Originally posted by Carlo Lazzaro View Post
                        Frans:
                        1) -xtgls- and -xtregar- support autocorrelation modelling, whereas -xtreg- does not;
                        2) you can find some interesting references in their entries in Stata.pdf manual.
                        Hi Carlo (Carlo Lazzaro),

                        I wonder why you said that -xtreg- does not support autocorrelation modelling?

                        Example 3 in Manual 13, xtreg, page 15 (https://www.stata.com/manuals13/xtxtreg.pdf) writes: "Clustering on the panel variable produces an estimator of the VCE that is robust to cross-sectional heteroskedasticity and within-panel (serial) correlation that is asymptotically equivalent to that proposed by Arellano (1987).

                        It means that -xtreg, fe- supports both heteroskedasticity and autocorrelation, doesn't it? Or do I understand incorreclty?
                        --------------------
                        (Stata 15.1 MP)

                        Comment


                        • #13
                          Lihn:
                          for instance, -xtgls- allows -corr(independent)- ,corr(ar1)-, -corr(psar1)-. Those options are not available from -xtreg-, that allows -robust- or -cluster- options to deal with both heteroskedasticity and within panel correlation (hence, you cannot model the latter as -xtgls- allows you to).
                          Kind regards,
                          Carlo
                          (StataNow 18.5)

                          Comment


                          • #14
                            Originally posted by Carlo Lazzaro View Post
                            Lihn:
                            for instance, -xtgls- allows -corr(independent)- ,corr(ar1)-, -corr(psar1)-. Those options are not available from -xtreg-, that allows -robust- or -cluster- options to deal with both heteroskedasticity and within panel correlation (hence, you cannot model the latter as -xtgls- allows you to).
                            I think I have a gap in econometrics knowledge here. Could you please clarify my two questions?

                            1. Is there a difference between autocorrelation, which is controlled by -xtreg,fe-, and autocorrelation, which is controlled by -xtgls,corr(independent)-?

                            2. If the answer for the first question is "Yes", -xtreg.fe- doest not appropriately deal with both heteroskedasticity and within panel correlation, does it?

                            --------------------
                            (Stata 15.1 MP)

                            Comment


                            • #15
                              Lihn:
                              1) the issue is that, even if -xtreg- control for autocorrelation, you cannot chose the model of autocorrelation (whereas you can with -xtgls- option).
                              2) What above does not mean that -xtreg.fe- does not approapriately deal with both heteroskedsticity and autocorrelation: it simply does not allow you to model the autocorrealtion as -xtgls- does.
                              The underlying reason is that modelling autocorrelation is an issue for T>N (long) panel datasets (-xtgls-), not (usually at least) for N>T (short) panel datasets (-xtreg-).
                              Kind regards,
                              Carlo
                              (StataNow 18.5)

                              Comment

                              Working...
                              X