如何复制eststo

How to copy eststo

如何复制 eststo 的内容并创建另一个 eststo

例如:

sysuse auto2, clear

eststo clear
eststo estimates1: reg price mpg rep78 headroom trunk weight length turn, robust
estadd local aa "abc"
estadd local bb "bcd"

esttab estimates1

我想做的是复制estimates1并创建estimates2。两者应该是一致的。

当然,一种方法是重新运行回归:

eststo clear
eststo estimates1: reg price mpg rep78 headroom trunk weight length turn, robust
    estadd scalar obs=e(N)
    estadd local aa "abc"
    estadd local bb "bcd"
eststo estimates2: reg price mpg rep78 headroom trunk weight length turn, robust
    estadd scalar obs=e(N)
    estadd local aa "abc"
    estadd local bb "bcd"   
esttab estimates1 estimates2, stats(obs aa bb)

但是有没有办法做这样的事情(不正确):

eststo estimates2 = estimates1

以下对我有用:

sysuse auto2, clear
eststo clear

eststo estimates1: reg price mpg rep78 headroom trunk weight length turn, robust

estadd scalar obs=e(N)
estadd local aa "abc"
estadd local bb "bcd"

eststo estimates2

esttab estimates1 estimates2, stats(obs aa bb)

请注意,以下内容也有效:

esttab estimates1 estimates1, stats(obs aa bb)

两种方法都会产生所需的输出:

--------------------------------------------
                      (1)             (2)   
                    price           price   
--------------------------------------------
mpg                -104.5          -104.5   
                  (-1.21)         (-1.21)   

rep78               723.2*          723.2*  
                   (2.29)          (2.29)   

headroom           -656.0*         -656.0*  
                  (-2.23)         (-2.23)   

trunk               79.23           79.23   
                   (1.05)          (1.05)   

weight              5.286*          5.286*  
                   (2.66)          (2.66)   

length             -93.33          -93.33   
                  (-1.51)         (-1.51)   

turn               -196.6          -196.6   
                  (-1.24)         (-1.24)   

_cons             16142.5*        16142.5*  
                   (2.08)          (2.08)   
--------------------------------------------
obs                    69              69                                          
aa                    abc             abc   
bb                    bcd             bcd   
--------------------------------------------
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001