Announcement

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

  • How to save IV first stage (preferably using ivregress and esttab commands)

    Hello


    I want to estimate a model like this:

    Code:
    xi: ivregress 2sls depvar (ib3.instrumented = ib3.instrument), small depname(depvar) first
    The regressions run smoothly - no problem.

    However, I do not achieve to store it properly.

    Mostly because I have 2 first stages: i1.instrument instruments i1.instrumented and i2.instrument instruments i2.instrumented. Data stems from an experiment and I want to estimate LATEs (so the assignment to treatment 1 instruments receiving treatment 1, being assigned to treatment 2 instruments actually receiving treatment2 and there is a control group, too --> 3 groups.


    I have many different dependent variables and I hope to find a way to always get a table that shows 3 columns of results: first stage 1, first stage 2, as well as IV estimates.


    Thank you in advance very much for your help!

    Last edited by Andrea Maier; 20 May 2020, 04:03. Reason: Edit:including missing code tags

  • #2
    xi: ivregress 2sls depvar (ib3.instrumented = ib3.instrument), small depname(depvar) first
    Mostly because I have 2 first stages:
    I do not understand what you mean by two first stages. This issue has been discussed many times in the forum, so you should search before posting.

    https://www.statalist.org/forums/for...eg2-by-outreg2

    Comment


    • #3
      Dear Andrew: Thank you! Even if I use outreg2 and ivreg2 I get into trouble. "estimation result not found" (Should have mentioned that)

      My instrument is a variable with 3 values (1, 2, 3). 1 and 2 are treatments, 3 is control. Therefore I create (ib3.) an indicator that is 1 for 1 and 1 for 2. Both indicators I regress on my endogenous variable (which is of the same type).

      Therefore I see a big difference to those other questions.

      Comment


      • #4
        Use of of the Stata's datasets to create a reproducible example. For example, you can start at

        Code:
        webuse hsng2, clear
        ivregress 2sls rent pcturban (hsngval =  i.region), small first

        Comment


        • #5
          Thanks for the advice.

          I got it going the following way:



          Code:
          ivreg2 depvar (ib3.instrumented = ib3.instrument) , first savefirst
          
          est restore _ivreg2_1_instrumented
          
          
          outreg2 using "myfile", replace
          
          ivreg2 depvar (ib3.instrumented = ib3.instrument) , first savefirst
          
          est restore _ivreg2_2_instrumented
          
          
          
          
          outreg2 using "myfile", append
          
          ivreg2 depvar (ib3.instrumented = ib3.instrument)
          outreg2 using "myfile", append

          I am not particularly happy with how I get the output (using outreg) but this is probably due to the fact that I always had esttab and that was just perfect and I am not skilled in outreg.

          Comment


          • #6
            You can use esttab (Stata Journal). Look at #9 in the link in #2.

            Comment


            • #7
              Thank you so much! This works, too!

              Comment

              Working...
              X