Announcement

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

  • Sanderson-Windmeijer multivariate F test of excluded instruments

    I am useing xtivreg, re. xtivreg2, fe produces the "Sanderson-Windmeijer multivariate F test of excluded instruments." Is there a way to carry out the same test after xtivreg, re?

  • #2
    You didn't get a quick response. You'll increase your chances of a useful answer by following the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data using dataex.

    If you had googled "Sanderson-Windmeijer multivariate F test of excluded instruments." you would have found the following paper that includes Stata code to do the test.
    https://research-information.bristol...01736_main.pdf. However, the paper doesn't derive results for a random effects estimation. I'm not sure whether having random effects would change the test.

    Comment


    • #3
      Thanks. The paper of SW explains how to carry out the test using ivregress. xtivreg2 probably follows the same procedure except that instead of ivregress, it uses xtivreg2. So one could replicate what xtivreg2 does using the xtivreg2 command. And then one could use xtivreg, re to carry out the test itself as explained in the paper of SW: so instead of ivregress, xtivreg, re. But this is the question. How do we know that SW test can be simply carried out on a fixed effects model? And how could we know that the SW test can be simply carried out on a random effects model? Could maybe the authors of xtivreg2 consider this question? That is, how do we know that the SW test is valid on a fixed effects regression? This could then imply if it is valid on a random effects regression.

      Comment


      • #4
        I would like to update the question I have posed above as follows. I am trying to obtain the SW statistic in FE and RE models "by hand", that is without using a third party package written for Stata, such as the xtoverid.

        First I calculate the test in a FE model "by hand", and then by using xtoverid. Please see below the routines 1a and 1b I follow. The conclusion is that the two routines give the same results. Hence I know that my calculation of the test "by hand" is correct.

        Then I calculate the test in a RE model "by hand", and then by using xtoverid. Please see below the routines 2a and 2b I follow. The conclusion is that the two routines give different results. Where would I be making the mistake?

        1a. Code for SW test in a FE model if the test is carried out by myself
        xtivreg HHHP (HHHF = ELA2 ELA3 ELA4) AII AII2, fe vce(cluster HHIDPN)
        predict resHHHP_FE, e
        xtreg resHHHP_FE ELA2 ELA3 ELA4 AII AII2, fe vce(cluster HHIDPN)
        test SFPbin ELA2 ELA3 ELA4
        scalar Fsw_FE = r(F)*r(df)/(r(df)-1)
        di Fsw_FE

        1b. Code for SW test in a FE model if the test is carried out using the xtoverid/xtivreg2 command
        xtivreg BMI (HHHP HHHF = ELA2 ELA3 ELA4) AII AII2, fe vce(robust)
        xtoverid, noi

        2a. Code for SW test in a RE model if the test is carried out by myself
        xtivreg HHHP (HHHF = ELA2 ELA3 ELA4) AII AII2, re vce(cluster HHIDPN)
        predict resHHHP_RE, ue // Also tried with just e instead of ue.
        xtreg resHHHP_RE ELA2 ELA3 ELA4 AII AII2, re vce(cluster HHIDPN)
        test EDUbin ELA2 ELA3 ELA4
        scalar F = r(chi2)/r(df)
        scalar Fsw_RE = F*r(df)/(r(df)-1)
        di Fsw_RE

        2b. Code for SW test in a RE model if the test is carried out using the xtoverid command
        xtivreg BMI (HHHP HHHF = ELA2 ELA3 ELA4) AII AII2, re vce(robust)
        xtoverid, noi

        Comment


        • #5
          Please read the first paragraph in #2 and act accordingly.
          Best regards,

          Marcos

          Comment


          • #6
            Thanks for the reply. I did not paste the Stata Output and uploaded the data as I thought the Stata code already gives enough information for the question. If someone is willing to dig into the question, I can send these too. Meanwhile a correction: SFPbin and EDUbin should be omitted from the code.
            Last edited by Tunga Kantarci; 09 Apr 2018, 10:22.

            Comment


            • #7
              The IV estimators for panel data and random effects in xtivreg are G2SLS or EC2SLS (I think I got the acronyms right). These are implemented by using GLS transforms and constructing variables and instrument sets and then doing IV on the transformed data. In principle what you could do is construct all the variables by hand and then do basic IV. It would be a bit of a hassle. But maybe not too bad if xtivreg leaves behind the necessary information (e.g. error variances for quasi-demeaning).

              Comment


              • #8
                Thanks Mark. I am not entirely clear about your answer, however. How should I relate the answer to the SW test? Is it clear where the routine 2a goes wrong?
                Last edited by Tunga Kantarci; 09 Apr 2018, 12:05.

                Comment


                • #9
                  (2a) is wrong because that's not how G2SLS or EC2SLS work. Your instruments (ELA2 ELA3 ELA4) are transformed internally by xtivreg before being used to do the IV estimation. That transformation will be different from the one used in your by-hand xtreg regression. To do the SW test properly, you need to first be able to mimic the actual IV estimation used by xtivreg on the correctly-transformed variables.

                  Baltagi's panel data book has a good discussion of IV with panel data and random effects.

                  Comment


                  • #10

                    Come to think of it, xtoverid has an undocumented option, noi (or noisily). If you say xtoverid, noi after your xtivreg estimation, it will report the internal reestimation (done by ivreg2) including the weak and under identification stats and (I think) the SW stats. The variables will have temp names but you should be able to work out which is which.

                    Comment


                    • #11
                      Hi everyone,

                      I have a question regarding the Sanderson-Windmeijer multivariate F test of excluded instruments:

                      The result that I am getting is

                      Sanderson-Windmeijer multivariate F test of excluded instruments:
                      F( 6, 17) = 13.43
                      Prob > F = 0.0000

                      How this can be interpreted?

                      Comment

                      Working...
                      X