Announcement

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

  • Rearranging Columns from Multiple-Equation Model using esttab

    I'm generating an output summary table from one probit and one ivprobit estimation, including the first-stage results from the ivprobit estimation.

    By default, esttab outputs the first-stage column to the right of the second-stage, and I would like this to be reversed, with the first-stage results in the middle column. If possible, I would also like to report the estimated sigma and rho parameters in the third column (with the second-stage estimates) as well.

    Here is a reproducible example:
    Code:
    sysuse auto, clear
    
    eststo r1: probit foreign price mpg
    eststo r2: ivprobit foreign mpg (price = weight), mle first
    
    esttab r1 r2, label cell(b(star fmt(a3)) se(par)) nomtitle collabels(none) eqlabel(none) unstack

  • #2
    estout is from SSC (FAQ Advice #12). You are unstacking your results and hiding the equation labels, so the multiple columns are artificial. Probably look to recreate the first stage results and replace the variance matrix using erepost from SSC (for the standard errors to match exactly). I don't do this last step in my illustration.

    Code:
    sysuse auto, clear
    eststo r1: probit foreign price mpg
    eststo r2: ivprobit foreign mpg (price = weight), mle first
    eststo first: reg price mpg weight if e(sample)
    esttab r1 first r2, label cell(b(star fmt(a3)) se(par)) nomtitle collab(none) drop(price:) eqlab(none)
    Res.:

    Code:
    . esttab r1 first r2, label cell(b(star fmt(a3)) se(par)) nomtitle collab(none) drop(price:) eqlab(none)
    
    --------------------------------------------------------------------
                                  (1)             (2)             (3)  
    --------------------------------------------------------------------
    Price                    0.000157*                      -0.000305***
                          (0.0000641)                     (0.0000486)  
    Mileage (mpg)               0.140***       -49.51         -0.0330  
                             (0.0374)         (86.16)        (0.0317)  
    Weight (lbs.)                               1.747**                
                                              (0.641)                  
    Constant                   -4.592***       1946.1           2.264*  
                              (1.116)        (3597.0)         (1.007)  
    athrho2_1                                                   2.386***
                                                              (0.451)  
    lnsigma2                                                    7.809***
                                                             (0.0822)  
    --------------------------------------------------------------------
    Observations                   74              74              74  
    --------------------------------------------------------------------
    
    .
    Last edited by Andrew Musau; 13 Mar 2023, 18:58.

    Comment


    • #3
      Thank you for the reply, Andrew. The problem is that, when using MLE for IV probit, the results are different than two-stage IV probit. I don't think it's possible to recreate the first-stage coefficients in a standalone estimation.

      Comment


      • #4
        That's why I suggested switching the VCE.

        Comment


        • #5
          Originally posted by Danny Edgel View Post
          Thank you for the reply, Andrew. The problem is that, when using MLE for IV probit, the results are different than two-stage IV probit. I don't think it's possible to recreate the first-stage coefficients in a standalone estimation.
          Here is what I mean in #2 and #4 using your example in #1. Install erepost first from SSC.

          Code:
          sysuse auto, clear
          eststo r1: probit foreign price mpg
          eststo r2: ivprobit foreign mpg (price = weight), mle first
          mat b= e(b)[1, "price:"]
          mat V= e(V)["price:", "price:"]
          reg price mpg weight if e(sample)
          erepost b=b, rename
          erepost V=V, rename
          eststo first
          esttab r1 first r2, label cell(b(star fmt(a3)) se(par)) nomtitle collab(none) drop(price:) eqlab(none)
          Res.:

          Code:
          . eststo r2: ivprobit foreign mpg (price = weight), mle first
          
          Fitting exogenous probit model
          
          Iteration 0:   log likelihood =  -45.03321  
          Iteration 1:   log likelihood = -20.083125  
          Iteration 2:   log likelihood = -17.363271  
          Iteration 3:   log likelihood = -17.152935  
          Iteration 4:   log likelihood = -17.151715  
          Iteration 5:   log likelihood = -17.151715  
          
          Fitting full model
          
          Iteration 0:   log likelihood = -700.04666  
          Iteration 1:   log likelihood = -700.01543  
          Iteration 2:   log likelihood =  -700.0154  
          
          Probit model with endogenous regressors         Number of obs     =         74
                                                          Wald chi2(2)      =      57.76
          Log likelihood =  -700.0154                     Prob > chi2       =     0.0000
          
          -----------------------------------------------------------------------------------------
                                  |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
          ------------------------+----------------------------------------------------------------
          foreign                 |
                            price |  -.0003047   .0000486    -6.27   0.000       -.0004   -.0002094
                              mpg |  -.0329678   .0317085    -1.04   0.298    -.0951154    .0291798
                            _cons |   2.263583   1.006505     2.25   0.025     .2908686    4.236297
          ------------------------+----------------------------------------------------------------
          price                   |
                              mpg |  -49.51272   84.39158    -0.59   0.557    -214.9172    115.8917
                           weight |   1.746554   .6282188     2.78   0.005     .5152679     2.97784
                            _cons |   1946.094   3523.382     0.55   0.581    -4959.608    8851.796
          ------------------------+----------------------------------------------------------------
                       /athrho2_1 |   2.386278   .4505905     5.30   0.000     1.503136    3.269419
                        /lnsigma2 |   7.808949   .0821991    95.00   0.000     7.647841    7.970056
          ------------------------+----------------------------------------------------------------
           corr(e.price,e.foreign)|   .9832244    .014991                      .9057134    .9971118
                       sd(e.price)|   2462.541   202.4187                      2096.116     2893.02
          -----------------------------------------------------------------------------------------
          Instrumented:  price
          Instruments:   mpg weight
          -----------------------------------------------------------------------------------------
          Wald test of exogeneity (corr = 0): chi2(1) = 28.05       Prob > chi2 = 0.0000
          
          
          . esttab r1 first r2, label cell(b(star fmt(a3)) se(par)) nomtitle collab(none) drop(price:) eqlab(none)
          
          --------------------------------------------------------------------
                                        (1)             (2)             (3)  
          --------------------------------------------------------------------
          Price                    0.000157*                      -0.000305***
                                (0.0000641)                     (0.0000486)  
          Mileage (mpg)               0.140***       -49.51         -0.0330  
                                   (0.0374)         (84.39)        (0.0317)  
          Weight (lbs.)                               1.747**                
                                                    (0.628)                   
          Constant                   -4.592***       1946.1           2.264*  
                                    (1.116)        (3523.4)         (1.007)  
          athrho2_1                                                   2.386***
                                                                    (0.451)  
          lnsigma2                                                    7.809***
                                                                   (0.0822)  
          --------------------------------------------------------------------
          Observations                   74              74              74  
          --------------------------------------------------------------------

          Comment

          Working...
          X