将控制变量的名称添加到ESTTAB输出中



我想使用 community-contributed 命令esttab

生成下表
------------------------------------------------------------
                      (1)             (2)             (3)   
------------------------------------------------------------
rep78               2.384***        1.347*          1.149*  
                   (3.60)          (2.02)          (2.26)   
Other Cont~s         None      gear_ratio            size   
Foreign Co~s           No             Yes             Yes   
------------------------------------------------------------
N                      69              69              69   
------------------------------------------------------------

我能达到的最接近的是:

------------------------------------------------------------
                      (1)             (2)             (3)   
------------------------------------------------------------
rep78               2.384***        1.347*          1.149*  
                   (3.60)          (2.02)          (2.26)   
Foreign Co~s           No             Yes             Yes   
------------------------------------------------------------
Other Cont~s         None      gear_ratio            size   
N                      69              69              69   
------------------------------------------------------------

让我在那里的代码如下:

sysuse auto, clear
eststo clear
eststo: reg mpg rep78
estadd local other_control "None"
eststo: reg mpg foreign rep78 gear_ratio 
estadd local other_control "gear_ratio"
eststo: reg mpg foreign rep78 weight length 
estadd local other_control "size"
esttab, obslast nomtitles nomtitles nodepvars eqlabels(none) keep(rep78) ///
scalars("other_control Other Controls") indicate("Foreign Controls = foreign")

任何帮助将不胜感激。

唯一可以实现所需输出的方法如下:

sysuse auto, clear
eststo clear
eststo: reg mpg rep78
eststo: reg mpg foreign rep78 gear_ratio 
eststo: reg mpg foreign rep78 weight length 
local OtherControls Other Controls{dup 7: }none{dup 6: }gear_ratio{dup 12: }size
local ForeignControls Foreign Controls{dup 7: }no{dup 13: }yes{dup 13: }yes
esttab, nomtitles keep(rep78) ///
prefoot(`" "' `"`OtherControls'"' `" "' `"`ForeignControls'"' `"{hline 60}"')
------------------------------------------------------------
                      (1)             (2)             (3)   
------------------------------------------------------------
rep78               2.384***        1.347*          1.149*  
                   (3.60)          (2.02)          (2.26)   
Other Controls       none      gear_ratio            size
Foreign Controls       no             yes             yes
------------------------------------------------------------
N                      69              69              69   
------------------------------------------------------------

最新更新