Добавление имени управляющих переменных в вывод esttab - PullRequest
0 голосов
/ 30 апреля 2019

Я хотел бы создать следующую таблицу с помощью команды от сообщества 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")

Любая помощь будет оценена.

1 Ответ

2 голосов
/ 30 апреля 2019

Способ only , позволяющий получить желаемый результат, следующий:

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   
------------------------------------------------------------
...