Announcement

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

  • "Estimates save" issue for using regression estimates from memory with outreg2

    Hi, I am having issues using the outreg2 command/estimates command. I have run a 3 regressions and stored each using the following code:
    Code:
     quietly xtreg yield co2 co2_2 temp temp_2 co2_temp, fe
    estimates save w1, replace
    quietly xtreg yield co2 co2_2 temp temp_2 co2_temp rgdpo_pc, fe
    estimates save w2, replace
    quietly xtreg yield co2 co2_2 temp temp_2 co2_temp rgdpo_pc hc, fe
    estimates save w3, replace
    And a similar set of code (same dependent and independent variables) using a different dataset for 3 more estimates and saving them as m1 m2 and m3 (I clear the original dataset say dataset A and then load dataset B, clearing A). I am trying to run the command:
    Code:
    outreg2 [w1 w2 w3 m1 m2 m3] using table1, tex replace tfmt(type) ctitle("(1)";"(2)";"(3)";"(4)";"(5)";"(6)")
    but Stata reports the error: "variable _est_w1 not found" r(111) which makes sense as the estimate is saved and not in the variables environment. So I try to ameliorate this by using:
    Code:
    estimates restore w1
    to which I get another error message: "estimation result w1 not found" r(111). The regression estimates are saved as .ster files in my directory.

    My main questions are: how do I properly store regression estimates so that I can recall them into the environment and use like regular post-regression estimates?

  • #2
    You want -estimates store-, not -estimates save- for this purpose. (You can also save them if you wish, but to use them in the way you want to here, you need -estimates store-.)

    Comment


    • #3
      Thank you, I figured it was clearing the estimates along with the data when I loaded a new dataset. I appreciate the help!

      Comment


      • #4
        Another follow up question/issue: I can use the stored result in -esttab- but not with -outreg2-?
        Code:
        . esttab m* w*
        
        ------------------------------------------------------------------------------------------------------------
                              (1)             (2)             (3)             (4)             (5)             (6)   
                            yield           yield           yield           yield           yield           yield   
        ------------------------------------------------------------------------------------------------------------
        co2                0.0466***       0.0329***       0.0188***        0.222***        0.223***        0.187***
                          (46.42)         (26.53)          (9.49)         (13.49)         (13.56)         (11.19)   
        
        temp                0.596***        0.182*          0.142*          0.243***        0.194***        0.145** 
                           (8.44)          (2.56)          (2.03)          (6.26)          (4.21)          (3.17)   
        
        temp_2            -0.0225***     -0.00851***     -0.00688**      -0.00325*       -0.00330*       -0.00364*  
                          (-9.96)         (-3.73)         (-3.06)         (-2.03)         (-2.06)         (-2.31)   
        
        rgdpo_pc                        0.0000847***    0.0000713***                   0.00000842*     0.00000309   
                                          (17.07)         (13.97)                          (1.99)          (0.73)   
        
        hc                                                  1.343***                                        0.939***
                                                           (9.03)                                          (8.31)   
        
        co2_2                                                           -0.000262***    -0.000269***    -0.000236***
                                                                         (-11.32)        (-11.50)        (-10.13)   
        
        co2_temp                                                        -0.000548***    -0.000406***    -0.000252*  
                                                                          (-6.71)         (-3.74)         (-2.32)   
        
        _cons              -15.34***       -9.233***       -6.823***       -42.83***       -42.41***       -35.85***
                         (-22.04)        (-12.37)         (-8.74)        (-14.53)        (-14.37)        (-11.91)   
        ------------------------------------------------------------------------------------------------------------
        N                    2307            2307            2307            2096            2096            2096   
        ------------------------------------------------------------------------------------------------------------
        t statistics in parentheses
        * p<0.05, ** p<0.01, *** p<0.001
        
        . outreg2 [m* w*] using faotable1, tex replace tfmt(type) ctitle("(1)";"(2)";"(3)";"(4)";"(5)";"(6)")
        variable _est_w* not found
        r(111);
        Any thoughts as to why this is happening?

        Comment


        • #5
          I'm not a user of -outreg2- so I'm not really sure. But I think the problem is that whereas -esttab- can expand m* w* to m1 m2 m3 w1 w2 w3, -outreg2- cannot. I think if you rewrite the command as -outreg2 [m1 m2 m3 w1 w2 w3]...- it will run.

          Comment


          • #6
            Sadly still does not run. Hopefully somebody else can shed some light on this, in the meantime I have somebody I can consult tomorrow.

            Comment

            Working...
            X