Announcement

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

  • Difference between xi: xtreg y x i.year, fe vs.

    I run the following panel data models:

    xtset country year
    xi: xtreg privinexdigdp_volarima100 l.capin l.instiqual l.finreform vix_median l.ln_privinexdigdp i.year, fe
    xtreg privinexdigdp_volarima100 l.capin l.instiqual l.finreform vix_median l.ln_privinexdigdp i.year, fe
    The only difference between the outputs is that vix_median is negative and not significant in the first, but positive and significant in the second. This variable does not vary across panels but obviously, varies across time. Can someone please explain what is happening here? Many thanks for your time.

  • #2
    Attached are these outputs.doubt.rtf
    Attached Files

    Comment


    • #3
      A lot of people won't open attachments. You'd be better off posting the output with code tags. See pt. 12 of the FAQ.

      I don't trust the output from xi: First off, it is a horribly antiquated command. But I don't see how you are getting all these nonzero (but very insignificant) coefficients for some of the year dummies. They should all be zero, like they basically are with the 2nd command. I suspect some sort of computational problem.
      -------------------------------------------
      Richard Williams, Notre Dame Dept of Sociology
      StataNow Version: 19.5 MP (2 processor)

      EMAIL: [email protected]
      WWW: https://www3.nd.edu/~rwilliam

      Comment


      • #4
        Here's my best guess as to what's going on. I suspect there is some multicolinear relationship among the different year indicators and vix_median. In the version with -xi:-, one of the year indicators is omitted by -xi-. In the other version, Stata chooses what to omit when it runs -xtreg- and chooses a different year. Consequently the models are different, and the variance that is jointly attributable to the years and vix_median gets re-partitioned.

        It is not possible to be sure of this because the output you show has been laundered through -esttab- or some similar post-processing, so we see nothing at all about what Stata has done with the i.year variables. But I suspect that had we seen that, it would be clear that different years are in play in the two estimations.

        Moral of the story: when showing results, do not show post-processed results. Directly show the output of the estimation commands. As noted here, the prettified versions can lose important information, in this case information that is probably critical to solving your problem.

        In addition, do not post output using attachments. Copy/paste directly from your Stata results window or log file directly into the Forum here, bound between code delimiters. If you are not familiar with code deilmiters, see FAQ #12 for instructions.

        Another point: -xi-: is largely obsolete at this point. In all but rare situations you will be better served by relying on factor-variable notation to create indicators and interaction terms. And most of the situations where factor-notation is not available are older commands whose functionality is available in more modern commands that do support factor variable notation.

        Added: Crossed with #3

        Comment


        • #5
          I take back what I said about how there shouldn't be year coefficients. But the output is definitely weird on the year coefficients. With xi:, many of the year coefficients are 0 with missing standard errors. But with the other, no year coefficients are shown. Something weird is going on, perhaps along the lines of what Clyde suggests, and skipping esttab and showing the original output may help.
          -------------------------------------------
          Richard Williams, Notre Dame Dept of Sociology
          StataNow Version: 19.5 MP (2 processor)

          EMAIL: [email protected]
          WWW: https://www3.nd.edu/~rwilliam

          Comment


          • #6
            Thanks a lot for your reply, Richard and Clyde. Sorry about pasting an attachment and not showing the output of the estimation commands. Going through this forum has made me aware that xi is used much less now, but the difference in the results got me wondering.

            xi: xtreg privinexdigdp_volarima100 l.capin l.instiqual l.finreform vix_median l.ln_privinexdigdp i.year, fe

            i.year _Iyear_1990-2014 (naturally coded; _Iyear_1990 omitted)
            note: _Iyear_1991 omitted because of collinearity
            note: _Iyear_1992 omitted because of collinearity
            note: _Iyear_1993 omitted because of collinearity
            note: _Iyear_1994 omitted because of collinearity
            note: _Iyear_1995 omitted because of collinearity
            note: _Iyear_1996 omitted because of collinearity
            note: _Iyear_2013 omitted because of collinearity
            note: _Iyear_2014 omitted because of collinearity

            Fixed-effects (within) regression Number of obs = 188
            Group variable: countrycode Number of groups = 15

            R-sq: Obs per group:
            within = 0.2000 min = 6
            between = 0.0625 avg = 12.5
            overall = 0.0642 max = 18

            F(21,152) = 1.81
            corr(u_i, Xb) = -0.7804 Prob > F = 0.0221

            ----------------------------------------------------------------------------------
            privinexdig~a100 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
            -----------------+----------------------------------------------------------------
            capin |
            L1. | .1342311 .0876012 1.53 0.128 -.0388421 .3073042
            |
            instiqual |
            L1. | -1.285812 2.945113 -0.44 0.663 -7.104454 4.532831
            |
            finreform |
            L1. | 18.44394 7.162496 2.58 0.011 4.293041 32.59484
            |
            vix_median | -2.138408 11.34903 -0.19 0.851 -24.56062 20.28381
            |
            ln_privinexdigdp |
            L1. | .1159127 .3607562 0.32 0.748 -.5968312 .8286566
            |
            _Iyear_1991 | 0 (omitted)
            _Iyear_1992 | 0 (omitted)
            _Iyear_1993 | 0 (omitted)
            _Iyear_1994 | 0 (omitted)
            _Iyear_1995 | 0 (omitted)
            _Iyear_1996 | 0 (omitted)
            _Iyear_1997 | 21.97624 82.19692 0.27 0.790 -140.4197 184.3722
            _Iyear_1998 | 27.54915 105.0226 0.26 0.793 -179.9433 235.0416
            _Iyear_1999 | 25.95018 118.3235 0.22 0.827 -207.8207 259.7211
            _Iyear_2000 | 21.32896 107.203 0.20 0.843 -190.4713 233.1292
            _Iyear_2001 | 25.45379 119.4668 0.21 0.832 -210.5761 261.4836
            _Iyear_2002 | 28.19248 141.4848 0.20 0.842 -251.3382 307.7231
            _Iyear_2003 | 12.67504 70.0137 0.18 0.857 -125.6506 151.0007
            _Iyear_2004 | 3.377247 19.22923 0.18 0.861 -34.61383 41.36832
            _Iyear_2005 | -3.681734 12.65983 -0.29 0.772 -28.69369 21.33022
            _Iyear_2006 | -4.710239 18.39891 -0.26 0.798 -41.06085 31.64038
            _Iyear_2007 | 5.275062 25.3377 0.21 0.835 -44.78448 55.33461
            _Iyear_2008 | 23.3849 125.9524 0.19 0.853 -225.4584 272.2282
            _Iyear_2009 | 30.67512 164.7695 0.19 0.853 -294.859 356.2092
            _Iyear_2010 | 17.66343 90.44138 0.20 0.845 -161.021 196.3479
            _Iyear_2011 | 15.65731 77.23261 0.20 0.840 -136.9307 168.2453
            _Iyear_2012 | 7.504586 42.00423 0.18 0.858 -75.48292 90.4921
            _Iyear_2013 | 0 (omitted)
            _Iyear_2014 | 0 (omitted)
            _cons | 14.81317 154.6982 0.10 0.924 -290.8232 320.4496
            -----------------+----------------------------------------------------------------
            sigma_u | 4.262887
            sigma_e | 4.3550667
            rho | .48930498 (fraction of variance due to u_i)
            ----------------------------------------------------------------------------------
            F test that all u_i=0: F(14, 152) = 3.12 Prob > F = 0.0003
            xtreg privinexdigdp_volarima100 l.capin l.instiqual l.finreform vix_median l.ln_privinexdigdp i.year, fe

            note: 2014.year omitted because of collinearity

            Fixed-effects (within) regression Number of obs = 188
            Group variable: countrycode Number of groups = 15

            R-sq: Obs per group:
            within = 0.2000 min = 6
            between = 0.0625 avg = 12.5
            overall = 0.0642 max = 18

            F(21,152) = 1.81
            corr(u_i, Xb) = -0.7804 Prob > F = 0.0221

            ----------------------------------------------------------------------------------
            privinexdig~a100 | Coef. Std. Err. t P>|t| [95% Conf. Interval]
            -----------------+----------------------------------------------------------------
            capin |
            L1. | .1342311 .0876012 1.53 0.128 -.0388421 .3073042
            |
            instiqual |
            L1. | -1.285812 2.945113 -0.44 0.663 -7.104454 4.532831
            |
            finreform |
            L1. | 18.44394 7.162496 2.58 0.011 4.293041 32.59484
            |
            vix_median | .8556297 .3596553 2.38 0.019 .1450608 1.566199
            |
            ln_privinexdigdp |
            L1. | .1159127 .3607562 0.32 0.748 -.5968312 .8286566
            |
            year |
            1998 | -.4451064 2.427874 -0.18 0.855 -5.241842 4.351629
            1999 | -5.547097 2.81432 -1.97 0.051 -11.10733 .0131378
            2000 | -7.234159 2.508338 -2.88 0.004 -12.18987 -2.278451
            2001 | -6.342899 2.900952 -2.19 0.030 -12.07429 -.6115065
            2002 | -9.412641 3.674747 -2.56 0.011 -16.67282 -2.152466
            2003 | -6.067639 2.027944 -2.99 0.003 -10.07424 -2.061043
            2004 | -1.952141 1.821486 -1.07 0.286 -5.550841 1.646558
            2005 | -.6577555 2.403255 -0.27 0.785 -5.405852 4.09034
            2006 | -.1593013 2.419386 -0.07 0.948 -4.939267 4.620665
            2007 | -1.671106 1.660902 -1.01 0.316 -4.952539 1.610327
            2008 | -10.11839 3.360049 -3.01 0.003 -16.75682 -3.479961
            2009 | -13.06778 4.645408 -2.81 0.006 -22.24568 -3.889877
            2010 | -6.468518 2.627733 -2.46 0.015 -11.66011 -1.276922
            2011 | -4.986578 2.470935 -2.02 0.045 -9.86839 -.104766
            2012 | -3.842819 1.965528 -1.96 0.052 -7.726101 .0404633
            2013 | -.5988076 2.239698 -0.27 0.790 -5.023765 3.82615
            2014 | 0 (omitted)
            |
            _cons | -25.60634 10.48323 -2.44 0.016 -46.318 -4.894679
            -----------------+----------------------------------------------------------------
            sigma_u | 4.262887
            sigma_e | 4.3550667
            rho | .48930498 (fraction of variance due to u_i)
            ----------------------------------------------------------------------------------
            F test that all u_i=0: F(14, 152) = 3.12 Prob > F = 0.0003

            Comment


            • #7
              This is much more complete, thank you. Code delimiters would have made it easier to read, but this is workable.

              Something very strange is going on. As I suspected, following -xi:- Stata is handling collinearity differently from how it handles it with factor variable notation. And this re-parameterization of the model is being reflected in the variable vix_median, which I still think is probably colinear with the year effects. You can test that by running:

              Code:
              regress vix_median i.year
              If my hypothesis is correct, you will get an exact linear equation for vix_median in terms of the year indicatars and R2 = 1 (or within rounding error of 1).

              We can see well that Stata does handle the colinearity among the year variables differently in the two models. In the factor variable notation 1997 and 2014 are omitted. In the xi: version, 2013 and 2014 are omitted. (The indicators for 1990 through 1996 are also omitted here, but in the factor variable version these aren't even recognized. My best guess is that due to the vagaries of missing data, there are no observations with those values of year in the estimation sample, or something like that.)

              If my prediction about the colinearity is wrong, then I don't know what the problem is. If it is right, then you don't really have a problem. It does mean, however, that the effect of vix_median is not identifiable from this data and you have to ignore that result, in either version.

              Comment


              • #8
                Hi Nitya. Figuring out how to add CODE tags can be a bit confusing when you're new to Statalist. The attached image shows how. (I hope it is clearly visible.)
                Click image for larger version

Name:	Statalist_editor_code_tags.png
Views:	1
Size:	43.7 KB
ID:	1408638
                --
                Bruce Weaver
                Email: [email protected]
                Version: Stata/MP 19.5 (Windows)

                Comment

                Working...
                X