Announcement

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

  • Endogeneity Test Panel Data

    Hello everyone,

    I have a question on endogeneity. How do I test in Stata if a variable in my panel data is endogenous or exogenous? I am currently using fixed effect on my panel data.

    Thank you so much
    Marco

  • #2
    Marco:
    the slide-set dowloadable at http://www.ifs.org.uk/docs/wooldridge%20session%204.pdf looks interesting.
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Thank you so much Carlo.

      I followed the link you sent me, but I am still insecure on how to interpret the results. I have run the following command xtivreg y xi (xj=z), fe endog(xj) and obtained the following results in Stata:

      Click image for larger version

Name:	pict.png
Views:	1
Size:	34.9 KB
ID:	1348031



      From this results, Can I conclude that:

      1) hh is a good instrumental variable (Chi-sq(1) P-val= 0.000000)?
      2) From the endogeneity test I reject the null that diff is endogenous. So there are no proves that diff is an endogenous variable.


      I looked for this answer on Statalist (here) and google, but the only post that I found with a similar question ( http://www.statalist.org/forums/foru...h-endog-option) was never answered.

      Thank you very much for your help.

      Marco





      Comment


      • #4
        I'm having a similar problem: my model is estimated by random effects, however with xtivereg , the options to test for endogenuity of the variable and instrument exog+relevance don't seem to work/ are not available. Is there anyway to get round this?

        Comment


        • #5
          Originally posted by Maggio Marco View Post
          Thank you so much Carlo.

          I followed the link you sent me, but I am still insecure on how to interpret the results. I have run the following command xtivreg y xi (xj=z), fe endog(xj) and obtained the following results in Stata:

          [ATTACH=CONFIG]n1348031[/ATTACH]


          From this results, Can I conclude that:

          1) hh is a good instrumental variable (Chi-sq(1) P-val= 0.000000)?
          2) From the endogeneity test I reject the null that diff is endogenous. So there are no proves that diff is an endogenous variable.


          I looked for this answer on Statalist (here) and google, but the only post that I found with a similar question ( http://www.statalist.org/forums/foru...h-endog-option) was never answered.

          Thank you very much for your help.

          Marco




          Marco: The null hypothesis is that diff is exogenous, and you are failing to reject that. That's different from what you said, although the response is the same in that you don't appear to need an instrument. You should do usual fixed effects (without IV) to see how the point estimate changes. My guess is not by much. You have interpreted the weak instrument test correctly: your instrument appears to be very strong (which, of course, says nothing about whether it is exogenous).

          Comment


          • #6
            Originally posted by Krissy Ragan View Post
            I'm having a similar problem: my model is estimated by random effects, however with xtivereg , the options to test for endogenuity of the variable and instrument exog+relevance don't seem to work/ are not available. Is there anyway to get round this?
            Krissy: Your case is a bit harder, but doable in Stata. I cover it in Section 11.2 in my MIT Press book, 2010, 2e. I think you have to do it "by hand" as xtreg2 does not support RE and xtregress does not have the endog test available.

            Let y1 be the dependent variable, y2 the endogenous explanatory variable, z1, ... zL the exogenous variables, with z1, ..., zM, M < L, included in the model.


            Code:
            reg y2 z1 z2 ... zL
            predict v2hat, resid
            xtreg y1 y2 v2hat z1 z2 ... zM, re vce(cluster id)
            The t statistic on v2hat is the test of the null that y2 is exogenous. If you reject, you conclude IV is needed. The test is fully robust to serial correlation and heteroskedasticity.

            A word of caution: You are requiring pretty strong exogeneity of your instrument. It must be uncorrelated with the heterogeneity in the structural equation, as well as the shocks. If your explanatory variable and instruments change over time, FEIV will be more convincing.

            JW

            Comment


            • #7
              Originally posted by Jeff Wooldridge View Post

              Krissy: Your case is a bit harder, but doable in Stata. I cover it in Section 11.2 in my MIT Press book, 2010, 2e. I think you have to do it "by hand" as xtreg2 does not support RE and xtregress does not have the endog test available.

              Let y1 be the dependent variable, y2 the endogenous explanatory variable, z1, ... zL the exogenous variables, with z1, ..., zM, M < L, included in the model.


              Code:
              reg y2 z1 z2 ... zL
              predict v2hat, resid
              xtreg y1 y2 v2hat z1 z2 ... zM, re vce(cluster id)
              The t statistic on v2hat is the test of the null that y2 is exogenous. If you reject, you conclude IV is needed. The test is fully robust to serial correlation and heteroskedasticity.

              A word of caution: You are requiring pretty strong exogeneity of your instrument. It must be uncorrelated with the heterogeneity in the structural equation, as well as the shocks. If your explanatory variable and instruments change over time, FEIV will be more convincing.

              JW
              Hi Jeff, thanks for that - I will try it. 1) Quick question, in your code:
              reg y2 z1 z2 ... zL Should reg be: xtreg, y2 z1 z2 ... z ? Does it matter if xtreg or reg? Does re vce(cluster varname) have to be included?

              2) Also I am running:

              xtivreg netreturn sin (religiositymean sinreligiositymean= statefav sinstatefav) beta lmarketcap lpb bev lgdp spread inflationrate open law year1 year2 year3 year4 year5 year6 year7 year8 year9 year10 country1 country2 country3 country4 country5 country6 country7 country8 , re vce(cluster company)

              And was told I can do xtoverid to test for the instrument relevance/exogenuity but I'm getting "o. operator not allowed
              r(101);"

              I haven't got any factor variables in the equation so wasn't sure why this is happening - could you assist?
              Last edited by Krissy Philips; 24 Feb 2017, 07:02.

              Comment


              • #8
                Could you recommend how I can run endogeneity tests and IV with xtprobit please? I don't think xtivreg2 is appropriate for my model as I am using nonlinear panel data methods. Thanks

                Comment


                • #9
                  Originally posted by Jeff Wooldridge View Post

                  Krissy: Your case is a bit harder, but doable in Stata. I cover it in Section 11.2 in my MIT Press book, 2010, 2e. I think you have to do it "by hand" as xtreg2 does not support RE and xtregress does not have the endog test available.

                  Let y1 be the dependent variable, y2 the endogenous explanatory variable, z1, ... zL the exogenous variables, with z1, ..., zM, M < L, included in the model.


                  Code:
                  reg y2 z1 z2 ... zL
                  predict v2hat, resid
                  xtreg y1 y2 v2hat z1 z2 ... zM, re vce(cluster id)
                  The t statistic on v2hat is the test of the null that y2 is exogenous. If you reject, you conclude IV is needed. The test is fully robust to serial correlation and heteroskedasticity.

                  A word of caution: You are requiring pretty strong exogeneity of your instrument. It must be uncorrelated with the heterogeneity in the structural equation, as well as the shocks. If your explanatory variable and instruments change over time, FEIV will be more convincing.

                  JW
                  Dear Jeff,

                  I tried to test the endogeneity of a variable under random-effects panel regression, using the method you mentioned. However, I do not understand why the number of exogenous variables in -xtreg y1 y2 v2hat z1 z2 ... zM, re vce(cluster id)- is smaller than that in -reg y2 z1 z2 ... zL-, (M<L).
                  Does it mean that I should randomly delete several exogenous variables in -xtreg-?

                  Thank you very much!

                  Comment


                  • #10
                    Dear Statalist respected users,

                    does the xtivreg2 command report 'only' the 2nd stage from the 2SLS regression? if yes, how can I get the first stage ?
                    Thank you

                    Comment


                    • #11
                      Jeff Wooldridge I am using xtivreg2 command. I have failed to reject the null hypothesis of endogeneity test, which means my variable is exogenous. I got p-value-0.00 for Hansen J test. How should one conclude these results? on the one hand it seems that simple fixed effect model is appropriate but the p-value of Hansen J statistics indicates that instruments are not valid. What does it indicates?

                      Comment


                      • #12
                        Hello All,

                        My question pertains to the result that displays "singleton groups detected; # observations deleted"

                        I was performing the FE model and had already deleted those firm-years that were present for only one year. Then after performing xtivreg2 with fixed effects , I also receive such result that singleton groups detected. Can someone please explain what are these "singleton groups" ?

                        Also, say one of my explanatory variable X is endogenous that I have instrumented by X_Prime. My model also incorporates an interaction of X (that is endogenous) with A (X*A). Should I create the instrument of interaction term by (X_Prime*A). And should run the following:

                        Code:
                        xtivreg2 Y controls (X XA = X_Prime X_Prime*A
                        I am really doubtful about the applicability (or appropriateness) of including such interaction term where only one of the variable is endogenous and other is not; here in this IV estimation.

                        Please help as this interaction term forms the core of my hypothesis testing. Any link to read more about such interactions in IV (Panel Data) that can help me in figuring out if such inclusion is even correct or not would be really helpful.

                        regards,
                        Mohina

                        Comment


                        • #13
                          Dear All,

                          I need urgent help with the following point.

                          Can someone please let me know how to include an interaction term and quadratic term that is endogenous in nature. I use the following code:

                          Code:
                          xtivreg2 ROTA (c.l.TBbyCE##c.l.TBbyCE c.L.TBbyCE#c.L.HHI_Net_Sales = c.l.New_Tang_NFAbyTA##c.l.New_Tang_NFAbyTA c.l.New_Tang_NFAbyTA#c.l.HHI_Net_Sales) Log_Real_TA HHI_Net_Sales M D Real_INV, fe robust endog(l.TBbyCE)
                          But I repeatedly get an error stating some problem with the interaction term here.

                          In fact I tried incorporating interaction term of non-endogenous variable as well, even then it is showing an error like this: "c.L.Variable 1# c.L. Variable 2 operator invalid"

                          Doesn't xtivreg2 allow for factor notations for quadratic or interaction terms?

                          Any readings on how to deal with quadratic and interaction term using xtivreg2

                          Please help!!

                          regards,
                          Mohina

                          Comment


                          • #14
                            I don’t think xtreg2 supports factor notation. Just create the interactions “by hand.” But you should center them around an interesting values, such as the mean or median, before multiplying them.

                            Comment


                            • #15
                              Many Many thanks Professor for the much needed revert.

                              Professor, leaving the factor notation, is the command that I have used to incorporate quadratic as well as interaction terms with an endogenous variable an appropriate one? My new code (upon creating variables manually and centering) would look like this:

                              Code:
                              xtivreg2 ROTA (l.Lev1 l.Lev1_Square l.Int_Lev1_HHI l.Int_Lev1_M l.Int_Lev1_D =  l.Tang l.Tang_Square l.Int_Tang_HHI l.Int_Tang_M l.Int_Tang_D)  l.HHI l.M l.D l.Size l.Real_INV, fe robust endog(l.TBbyCE)
                              Can you please clarify this?

                              Also, I am presently having firm level unbalanced panel data, as HHI is an industry level variable that is same for all the firms and vary only yearly, so the centering of this variable [HHIit - average(HHIi.)] is appropriate or not? I feel as the deviation would vary for each firm, so it should not be problematic. Am I right here?

                              regards,
                              Mohina

                              Comment

                              Working...
                              X