Announcement

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

  • Display estimators of different regressions in one column (estout)

    Dear Statalist,

    I am using Stata 16 on a windows device.

    I want to perform the same regression model in various subsamples, each of which is created by splitting the full sample in two parts with a similar number of observations based on different variables.

    To give an example, the interest rate a company has to pay shall be explained by it's Return on Assets (RoA) and the Equity ratio (Eq_ratio). Moreover, we have two dummy variables assigning the companies to high- and low risk groups, based on the country of their destination (H_risk_count) and their industry (H_risk_ind):

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float(Interest_rate RoA Eq_ratio H_risk_count H_risk_ind)
     .04   .1  .4 1 0
    .035   .2  .5 1 0
     .06  .08 .25 1 1
     .05   .4  .5 0 0
    .027  .12  .7 1 1
    .017   .1 .55 1 1
     .03  .08  .3 0 1
     .08  .05 .45 0 0
     .04  .15  .4 0 1
    .032   .1  .6 0 1
    .053  .08 .15 0 1
    .026   .1  .7 0 1
    .091  .05  .4 0 1
    .043  .04 .35 0 0
    .027  .08  .8 0 1
    .038  .15  .5 0 0
    .045   .1  .3 1 0
     .05  .03  .6 1 0
    .065 -.05  .5 1 1
    .072  .08  .8 1 0
    end
    Now let's assume, I want to perform the regression separately for the high- and low risk group, as defined by both variables. Then, I want to generate a result table that shows only the estimators for RoA. The table should have two columns, one containing all estimators for the different high-risk samples, the other one for the low-risk samples and one row for every risk-defining variable.

    Up to now, I've tried the following:

    Code:
    preserve
    keep if H_risk_count == 1
    rename RoA country
    regress Interest_rate country Eq_ratio
    estimates store a
    restore
    
    preserve
    keep if H_risk_count == 0
    rename RoA country
    regress Interest_rate country Eq_ratio
    estimates store b
    restore
    
    preserve
    keep if H_risk_ind == 1
    rename RoA industry
    regress Interest_rate industry Eq_ratio
    estimates store c
    restore
    
    preserve
    keep if H_risk_ind == 0
    rename RoA industry
    regress Interest_rate industry Eq_ratio
    estimates store d
    restore
    
    esttab a b c d, keep(country industry)
    This leaves me with the following result:

    Code:
    ----------------------------------------------------------------------------
                          (1)             (2)             (3)             (4)   
                 Interest_r~e    Interest_r~e    Interest_r~e    Interest_r~e   
    ----------------------------------------------------------------------------
    country            -0.150         -0.0175                                   
                      (-1.65)         (-0.25)                                   
    
    industry                                           -0.223         -0.0352   
                                                      (-2.04)         (-0.75)   
    ----------------------------------------------------------------------------
    N                       9              11              11               9   
    ----------------------------------------------------------------------------
    t statistics in parentheses
    * p<0.05, ** p<0.01, *** p<0.001
    However, as described I would like to have only two columns with the results of (3) in (1) and (4) in (2), so I could rename the columns as "high risk" and "low risk".

    Is there a way to achieve this without to many manual changes of the output table?

    Kind regards
    Ingo

  • #2
    estout is from SSC (FAQ Advice #12). Search the forum for mentions of appendmodels by Ben Jann.

    Comment


    • #3
      Thank you for your response Andrew! I will have a look into appendmodels.

      Comment

      Working...
      X