How do I create a table wth both plain and robust standard errors?

旧时模样 提交于 2020-06-16 07:45:11

问题


I often see regression tables in publications where the plain standard errors are reported (in parentheses), together with the robust standard errors (in brackets) below the plain standard errors. The tables also include the accompanying asterisks beside the parentheses/brackets indicating statistical significance.

What is the most sensible way to create regression reports like these?

So far, I have been using the estout package in Stata. For a given model, I could have one column with the plain standard error and another with the robust one.

For example, using estout, I could do the following:

eststo: qui reg ROE duality
eststo: qui reg ROE duality, vce(cluster firm)

esttab b(%9.3fc) ///                     
       se(%9.3fc) ///
       star (* 0.5 ** 0.25)

The aforementioned code snippet produces:

--------------------------------------------
                (1)             (2)   
                ROE             ROE   
--------------------------------------------
duality       -8.090**        -8.090*   
              (6.585)         (7.067)   
--------------------------------------------
N               647             647   
--------------------------------------------

However, this table wastes column space as the point estimates of the two columns will be identical, with the only difference being the standard errors from the different variance-covariance estimators.

What I would much rather have is a table like the one below:

 ------------------------
                (1)      
                ROE      
-------------------------
duality       -8.090     
              (6.585)** 
              [7.067]*   
-------------------------
N               647      
-------------------------

Note that indication of statistical significance at 0.5 and 0.25 is for illustration here only and certainly does not reflect convention.


回答1:


You just need to manually add the robust standard errors:

sysuse auto, clear
eststo clear

quietly regress price weight mpg, vce(robust)
matrix regtab = r(table)
matrix regtab = regtab[2,1...]
matrix rbse = regtab

eststo: quietly regress price weight mpg

estadd matrix rbse = rbse
esttab, cells(b se rbse)

-------------------------
                      (1)
                    price
                b/se/rbse
-------------------------
weight           1.746559
                 .6413538
                  .777837
mpg             -49.51222
                 86.15604
                  95.8074
_cons            1946.069
                  3597.05
                 4213.793
-------------------------
N                      74
-------------------------

Formatting it to your specifications requires using the relevant options:

esttab , cells("b(fmt(a3) star)" "se(fmt(a2) par)" "rbse(fmt(a2) par([ ]))") ///
star(* 0.5 ** 0.25)  addnote("Robust SE in brackets" "* p<0.5, ** p<0.25") ///
nonumbers

---------------------------
                    price  
                b/se/rbse  
---------------------------
weight              1.747**
                   (0.64)  
                   [0.78]  
mpg                -49.51  
                   (86.2)  
                   [95.8]  
_cons              1946.1  
                 (3597.0)  
                 [4213.8]  
---------------------------
N                      74  
---------------------------
Robust SE in brackets
* p<0.5, ** p<0.25



回答2:


Note that appropriate indication of significance can be displayed for both the regular standard errors and the robust standard errors separately by including the robust p-values in the estimation set and then selecting them using the pvalue() suboption within cells(). Here is an example:

sysuse auto

regress price weight mpg
est sto m1
regress price weight mpg, vce(robust)
matrix table = r(table)
matrix r_se = table[2,1...]
matrix r_p = table[4,1...]
estadd matrix r_se: m1
estadd matrix r_p: m1

regress price weight mpg turn
est sto m2
regress price weight mpg turn, vce(robust)
matrix table = r(table)
matrix r_se = table[2,1...]
matrix r_p = table[4,1...]
estadd matrix r_se: m2
estadd matrix r_p: m2

esttab m1 m2, mtitle nonumber            ///
   cell(b(fmt(a3))                       ///
        se(par star)                     ///
        r_se(par([ ]) star pvalue(r_p))  ///
        )                                ///
    note(@starlegend)

--------------------------------------------
                       m1              m2   
                b/se/r_se       b/se/r_se   
--------------------------------------------
weight              1.747           3.524   
                  (0.641)**       (0.817)***
                  [0.778]*        [1.159]** 
mpg                -49.51          -72.87   
                  (86.16)         (81.30)   
                  [95.81]         [97.07]   
turn                               -395.2   
                                  (122.6)** 
                                  [177.4]*  
_cons              1946.1         12744.2   
                 (3597.0)        (4760.1)** 
                 [4213.8]        [6429.0]   
--------------------------------------------
N                      74              74   
--------------------------------------------
* p<0.05, ** p<0.01, *** p<0.001


来源:https://stackoverflow.com/questions/51816692/how-do-i-create-a-table-wth-both-plain-and-robust-standard-errors

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!