Announcement

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

  • xtivreg2 and the endogeneity tests

    Hi,

    I am using the xtivreg2 command to estimate a FE-IV model. I would like to ask two questions which regard the endogeneity test, and the versions of it, produced by xtivreg2.

    1. If I understand it correctly, if the "robust" and "cluster" options are specified in the xtivreg2 command, xtivreg2 calculates a version of the endogneiety test that is robust to heteroskedasticity and serial correlation within panel groups. I would like to see the exact formula used to calculate the endogeneity test. In the documentation file for "ivregress postestimation" (http://www.stata.com/manuals13/rivre...estimation.pdf) page 15 gives some information. From this information, I suspect the statistic in question is Wooldridge’s (1995) score test because the documentation file states "(...) this test can be made robust to heteroskedasticity, autocorrelation, or clustering by using the appropriate robust VCE (...)". On the other hand, the documentation of ivreg2 does not specify the exact formula used. Which endogeneity test is used here? Where can I find the exact formulas calculating the versions of the test that are robust to heteroskedasticity, robust to serial correlation in the errors within panel groups, and robust to both at the same time?

    2. The command I use to obtain the endogeneity test is "xtivreg2 dependent $model, fe endog(varone vartwo) robust cluster(panelid)" which leads to "-endog- option: Endogeneity test of endogenous regressors: 24.977 Chi-sq(2) P-val = 0.0000". I also wanted to check the result produced by the "estat endogenous" command that can be executed after the ivregress command. For this, I first execute "xtdata dependent independent instruments, i(panelid) fe clear" to obtain the differenced data so that I could execute "ivregress 2sls dependent $model, robust cluster(panelid)". Following this, I execute the "estat endogenous" command which leads to "Robust regression F(2,12814) = 12.1324 (p = 0.0000) (Adjusted for 12815 clusters in HHIDPN)".
    I expected that the endogeneity option of the xtivreg2 command and the output of the estat endogenous command both use the same endogeneity test and hence lead to the same test value. Apperantly they use different statistics, or that my approach of differncing the data and using the ivregress command incorrect, although I cannot really think of a reason why it would be incorrect because I obtain the very same coefficient estimates in xtivreg2 and in ivregress after differencing. From the documentation of "estat endogenous", the formula used to calculate the endogeneity test, that is robust to heterskedasticity and serial correlation within panel groups, is not clear to me. Is there a Stata reference that clearly states the statistics and formulas used by estat endogenous?


    Tunga

  • #2
    Hi,

    This is an update to my first question above - I cannot seem to edit the original message instead. It now seems to me that, from what is explained under "estat endogenous" in http://www.stata.com/manuals13/rivre...estimation.pdf, it is the regression-based endogeneity test of Hausman (but the version of it robust to heteroskedasticity and serial correlation within panel groups) that xtivreg2 uses when caluculating the ednogeneity test if the robust and cluster options are specified while executing xtivreg2. Hence it is probably not Wooldridge’s (1995) score test, but a cluster-robust version of the classical Hausman statistic that is being considered by xtivreg2. Would this guess be correct? If I am not overlooking, documentation of xtivreg2 is not explicit on the test used.

    Tunga

    Comment


    • #3
      Hi,

      Would it be possible, perhaps for Mark as the author, to consider my questions on xtivreg2 above?

      Tunga

      Comment


      • #4
        The Help for xtivreg2 references a Stata Journal article, which is now freely downloadable at http://www.stata-journal.com/article...article=st0030. Perhaps that will answer your question.
        Steve Samuels
        Statistical Consulting
        [email protected]

        Stata 14.2

        Comment


        • #5
          Steve is right - xtivreg2 is just a wrapper for ivreg2 (after applying the relevant panel data transformation to the data), so for discussion of the tests implemented in xtivreg2 just check the help file for ivreg2 or the Stata Journal articles cited therein.

          Comment


          • #6
            Hi,

            I have checked the documentation of ivreg2 and the article at http://www.stata-journal.com/article...article=st0030. They provide detailed information on various subjects indeed. They are explicit on the statsitics used. However, they are not always explicit on the versions of the statistics used.

            Regarding my question 1 above: I simply would like to ask which statistic (or the version of the regarding statistic) is used as the test for endogeneity test "in the presence of heteroskedasticity and serial correlation on panel groups".

            Regarding my question 2 above: I still would like to pose this question (in fact a couple of questions: please see the original message) because I cannot find explicit explanations in the recommended documentation files.

            Tunga

            Comment


            • #7
              Tunga Kantarci: The output below may help. It contains three calculations of the endogeneity test. It would be useful if you ask your question in the context of the output below
              Code:
               . *ivreg2
              . ivreg2 lpackpc (lravgprs = rtaxso), first r endog(lravgprs)
                  (output omitted)
              
              -endog- option:
              Endogeneity test of endogenous regressors:                               0.310
                                                                 Chi-sq(1) P-val =    0.5779
              
              . 
              . * Actual calculation
              . reg lravgprs rtaxso, r
              
              Linear regression                                      Number of obs =      48
                                                                     F(  1,    46) =   40.39
                                                                     Prob > F      =  0.0000
                                                                     R-squared     =  0.4710
                                                                     Root MSE      =  .09394
              
              ------------------------------------------------------------------------------
                           |               Robust
                  lravgprs |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                    rtaxso |   .0307289   .0048354     6.35   0.000     .0209956    .0404621
                     _cons |   4.616546   .0289177   159.64   0.000     4.558338    4.674755
              ------------------------------------------------------------------------------
              
              . predict uhat1, resid
              
              . reg lpackpc lravgprs uhat1, r
              
              Linear regression                                      Number of obs =      48
                                                                     F(  2,    45) =   21.22
                                                                     Prob > F      =  0.0000
                                                                     R-squared     =  0.4099
                                                                     Root MSE      =  .19105
              
              ------------------------------------------------------------------------------
                           |               Robust
                   lpackpc |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                  lravgprs |  -1.083587   .3316194    -3.27   0.002    -1.751502   -.4156707
                     uhat1 |  -.2447442   .4569506    -0.54   0.595     -1.16509    .6756016
                     _cons |   9.719876   1.589345     6.12   0.000     6.518771    12.92098
              ------------------------------------------------------------------------------
              
              
              
              . *ivregress (post-)estimation
              . ivregress 2sls lpackpc (lravgprs = rtaxso), r
              
              Instrumental variables (2SLS) regression               Number of obs =      48
                                                                     Wald chi2(1)  =   12.05
                                                                     Prob > chi2   =  0.0005
                                                                     R-squared     =  0.4011
                                                                     Root MSE      =  .18635
              
              ------------------------------------------------------------------------------
                           |               Robust
                   lpackpc |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                  lravgprs |  -1.083587   .3122035    -3.47   0.001    -1.695494    -.471679
                     _cons |   9.719876   1.496143     6.50   0.000      6.78749    12.65226
              ------------------------------------------------------------------------------
              Instrumented:  lravgprs
              Instruments:   rtaxso
              
              . estat endogenous
              
                Tests of endogeneity
                Ho: variables are exogenous
              
                Robust score chi2(1)            =  .309568  (p = 0.5779)
                Robust regression F(1,45)       =  .286871  (p = 0.5949)

              Comment


              • #8
                Tunga: the endogeneity test reported is known variously as a "C test" or "GMM Distance test" or "Difference-in-J test". It is discussed in the context of ivreg2 in Baum et al. (2003) in sections 4.4 and 5. The references therein for a full discussion of the test are in footnote 15: Hayashi (2000) and Ruud (2000).

                Comment


                • #9
                  Dear Statalist,

                  Please excuse me if I am mis - posting my question. And if possible, please direct me to where I can best post it to on the forum to get a response that may assist me accordingly. I am conducting a 2SLS estimation with xtivreg2, and I am coming across a post estimation result in the "number of observations" element. When I conduct an OLS regression my post estimation number of observations is approximately 300. However, when I conduct the 2SLS, post estimation number of observations element is indicating 100, which I believe is just too small. My panel is unbalanced, N=24 and T is 16 years. I have considered that perhaps the lags in my 2SLS could be affecting the observations, however, I think the result is a bit on the extreme. If dear readers you could assist me on this, it would help me understand what is going wrong.

                  Angie

                  Comment

                  Working...
                  X