Announcement

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

  • #16
    Just ssc install ivreg2, replace will do it.

    Comment


    • #17
      -ssc install ivreg2, replace-
      Do not forget the comma followed by a space and replace

      Comment


      • #18
        I installed version 4.1.08, but I still have the problem that the endogeneity test is not reported.

        Comment


        • #19
          Can you send me your dataset by email so that I can reproduce the error myself and fix it? Easiest way by far (and I will of course delete it from my machine after finding and fixing the bug).

          Comment


          • #20
            I’ve sent you the data set via private message this morning since I could not find your email address here.

            I have an additional question with reference to the interpretation of my results. My estimators for 2SLS are significant, the OLS results however are not significant.
            But at the same time, the DWH statistics indicates that my regressors (lnGDP, ..) are exogenous. Is this a contradiction of my results?
            Or is it possible to say that my estimators are significant when using IV, but because of the results of the DWH statistics, their explanatory power is limited?


            Comment


            • #21
              It is not a contradiction to get different results from OLS and IV, even with exogenous variables. It's important to remember that an IV estimate is not the same as OLS, even with valid instruments.

              I don't know if you are familiar with the concept of a local average treatment effect (LATE), but it gives a very simple explanation as to why this is the case. To make it simple, let's assume you have a single dummy variable for your instrument (the intuition is the same with more IVs, just more complicated). With a couple rather innocuous assumptions, the IV can be interpreted as a LATE. In essence, this means that the IV estimate you get is actually the effect for your instrumented independent variable of interest is the effect of the independent variable for those that are moved by the instrument. For example, if the instrument is a dummy for being drafted for the Vietnam War (1=drafted, 0=not drafted), then the IV estimate is the effect of being drafted only for those that are moved by the instrument; that is, for those that became soldiers only because they were drafted and those that were not soldiers only because they were not drafted.

              Of course, in the example, the variable of interested (military service) is clearly endogenous. But what's important to remember is that an IV is essentially reweighting the effects, so there is no reason to expect them to be the same as OLS estimates.

              Hope this helps.

              Comment


              • #22
                Thanks Teresa - I picked up the dataset and I will try to reproduce and fix the bug. Will report back here when I get to the bottom of it.

                With respect to your question, it's a judgement call for you to make. If you have strong reasons to think that the regressors are endogenous, then you could conclude that even though the DWH test suggests you can treat the regressors as exogenous and OLS can be used, you can still point to the IV results as the main results. On the other hand, if you look at the IV results and conclude that you shouldn't trust them because e.g. the instruments are weak or they look otherwise dubious, then you may want to point to the OLS results as the main results.

                Comment


                • #23
                  Teresa - I was able to trace the bug - it was very obscure. In a nutshell, the recursive call to ivreg2 to get the endogeneity test statistic was using Mata's QR solver instead of the Cholesky solver. The matrix being inverted was positive definite, so Cholesky would have been OK, but because the matrix was ill-conditioned the QR solver wasn't giving an accurate solution (there's a related discussion in Mata's online help under help mf_lusolve). I've fixed it so that ivreg2 uses QR only if Cholesky fails.

                  Thanks again for the use of the dataset and the assistance in tracing the bug - much appreciated.

                  An ivreg2 update will show up on SSC in due course.

                  Comment


                  • #24
                    Thank you so much for solving this problem!

                    I have another problem within my postestimation, maybe you can also help me with this.
                    As I have between 2 and 4 endogenous regressors in my regressions, I used the Kleibergen-Paap rk Wald statistic to test whether my instruments are weak. I compare the test statistic with the Stock-Yogo weak ID test critical values.
                    I also like to make a statement about my first stage regression. Help ivreg2 says that “in the special case of a single regressor, the Sanderson-Windmeijer-F statistic reported is identical to the Kleibergen-Paap rk Wald statistic”. Therefore, I tried to make a statement about the weakness of my instruments in the first-stage.
                    For the endogenous variable lnGDP, I get for my first stage regression:
                    Click image for larger version

Name:	Unbenannt.PNG
Views:	1
Size:	4.1 KB
ID:	1307125

                    So I compared the SW-F-statistic (3.70) to the Stock-Yogo weak ID test critical values. As I have one endogenous regressor (n=1), 8 instruments (K=8), I get the following critical values for a maximal bias level of 0.1, 0.2, and 0.3:
                    b1= 11.39, b2=6.69, b3=4.99 (from Stock and Yogo (2002)).
                    The test rejects if the F-statistic exceeds the critical value, therefore I get
                    b1 : 3.70 < 11.39
                    b2: 3.70 < 6.69
                    b3: 3.70 < 4.99
                    I cannot reject the H0 and therefore my instruments are weak.


                    But if I look at the F test of excluded instruments, then I can clearly say that my instruments are not weak (F=100 > 10).

                    Where does this contradiction come from? I have the same problem for all other endogenous regressors.

                    Comment


                    • #25
                      Teresa - you can get the intuition from a simple example.

                      Say you have two endogenous regressors X1 and X2, and two excluded instruments Z1 and Z2. Say also that Z1 is strongly correlated with both X1 and X2, but Z2 is complete noise and uncorrelated with anything.

                      In your first-stage regressions for X1 and X2 taken separately, you'll find that both the "naive" first-stage F stats for the excluded instruments are big. That's because of Z1. Z2 is doing nothing in both.

                      But when you look at identification for both coefficients (on X1 and X2) taken together, you'll find your model is underidentified. You can't identify two coefficients (on X1 and X2) with only one useful instrument (Z1). Anderson, Cragg-Donald, Kleibergen-Paap, Sanderson-Windmeijer et al. take this into account. The "naive" first-stage F stat doesn't.

                      [More formally, the order condition for identification is satisfied but the rank condition isn't, and it's the rank condition that matters.]

                      This is discussed in more detail in one of the two Stata Journal articles that Kit Baum, Steve Stillman and I wrote (can't remember which; maybe both).

                      Comment


                      • #26
                        Thank you again for your help!

                        Comment


                        • #27
                          Teresa - FYI the new version of ivreg2 that is on SSC now (4.1.09) fixes the bug you found, so if you like you can go back to using ivreg2 without the version 10: prefix. Thanks again for helping spot it!

                          Comment

                          Working...
                          X