Stata 在esttab中放置假人

Stata 在esttab中放置假人,stata,Stata,我尝试使用社区提供的命令系列创建表estout: esttab est1 est2 est3 using table3.tex, se label nobaselevels /// star(* 0.10 ** 0.05 *** 0.01) cell((coef(fmt(%9.2f)) sd(fmt(%9.2f)))) /// drop(_Iprovince* _Iyear*) stats(year province robust r2 N, /// label("Year Fixed Effe

我尝试使用社区提供的命令系列创建表
estout

esttab est1 est2 est3 using table3.tex, se label nobaselevels ///
star(* 0.10 ** 0.05 *** 0.01) cell((coef(fmt(%9.2f)) sd(fmt(%9.2f)))) ///
drop(_Iprovince* _Iyear*) stats(year province robust r2 N, ///
label("Year Fixed Effects" "Province Fixed Effects" "Robust SE" "R-squared")) ///
replace booktabs
但是,Stata会产生以下错误:

未找到系数_i提供*

这些是“固定效果”的假人,我想把它们扔掉

当我取出
cell()
时,代码工作正常


最后,我如何将系数估计值和标准误差进行汇总?

除非您有非常旧的Stata版本,否则不要使用
xi
创建FEs。改用因子变量表示法
i.province
i.year

代码的主要问题是您应该使用
b
而不是
coef
(Stata不能删除系数,因为它们不包括在内,除非您告诉Stata您需要它们):


请注意共享数据集上的可复制示例

除非您有非常旧版本的Stata,否则不要使用
xi
创建FEs。改用因子变量表示法
i.province
i.year

代码的主要问题是您应该使用
b
而不是
coef
(Stata不能删除系数,因为它们不包括在内,除非您告诉Stata您需要它们):


请注意共享数据集上的可复制示例

代码不会执行,因为您正在
esttab
子选项
sd
而不是
se

sysuse auto, clear

eststo est1: xi: reg price mpg i.rep78
i.rep78           _Irep78_1-5         (naturally coded; _Irep78_1 omitted)

      Source |       SS           df       MS      Number of obs   =        69
-------------+----------------------------------   F(5, 63)        =      4.39
       Model |   149020603         5  29804120.7   Prob > F        =    0.0017
    Residual |   427776355        63  6790100.88   R-squared       =    0.2584
-------------+----------------------------------   Adj R-squared   =    0.1995
       Total |   576796959        68  8482308.22   Root MSE        =    2605.8

------------------------------------------------------------------------------
       price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         mpg |  -280.2615   61.57666    -4.55   0.000    -403.3126   -157.2103
   _Irep78_2 |   877.6347   2063.285     0.43   0.672     -3245.51     5000.78
   _Irep78_3 |   1425.657   1905.438     0.75   0.457    -2382.057    5233.371
   _Irep78_4 |   1693.841   1942.669     0.87   0.387    -2188.274    5575.956
   _Irep78_5 |   3131.982   2041.049     1.53   0.130    -946.7282    7210.693
       _cons |   10449.99   2251.041     4.64   0.000     5951.646    14948.34
------------------------------------------------------------------------------

esttab est1, cell((coef(fmt(%9.2f)) sd(fmt(%9.2f)))) label nobaselevels ///
star(* 0.10 ** 0.05 *** 0.01) stats(b r2 N) drop(_Irep78*)
coefficient _Irep78* not found
r(111);
如果使用正确的子选项
se
,代码将运行:

esttab est1, cell((coef(fmt(%9.2f)) se(fmt(%9.2f)))) label nobaselevels ///
star(* 0.10 ** 0.05 *** 0.01) stats(r2 N) drop(_Irep78*)

----------------------------------------------
                              (1)             
                            Price             
                             coef           se
----------------------------------------------
Mileage (mpg)                            61.58
Constant                               2251.04
----------------------------------------------
r2                           0.26             
N                           69.00             
----------------------------------------------
但是,子选项
coeflabels
(代码中的
coef
)应该仅 指定beta系数的标签,但不包括它们

因此,您需要使用中建议的子选项
b
@迪米特里的回答是:

esttab est1, cell((b(fmt(%9.2f)) se(fmt(%9.2f)))) label nobaselevels ///
star(* 0.10 ** 0.05 *** 0.01) stats(r2 N) drop(_Irep78*)

----------------------------------------------
                              (1)             
                            Price             
                                b           se
----------------------------------------------
Mileage (mpg)             -280.26        61.58
Constant                 10449.99      2251.04
----------------------------------------------
r2                           0.26             
N                           69.00             
----------------------------------------------
以下是
esttab
中的完整输出(不删除任何内容):


由于您正在
esttab
子选项
sd
而不是
se

sysuse auto, clear

eststo est1: xi: reg price mpg i.rep78
i.rep78           _Irep78_1-5         (naturally coded; _Irep78_1 omitted)

      Source |       SS           df       MS      Number of obs   =        69
-------------+----------------------------------   F(5, 63)        =      4.39
       Model |   149020603         5  29804120.7   Prob > F        =    0.0017
    Residual |   427776355        63  6790100.88   R-squared       =    0.2584
-------------+----------------------------------   Adj R-squared   =    0.1995
       Total |   576796959        68  8482308.22   Root MSE        =    2605.8

------------------------------------------------------------------------------
       price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         mpg |  -280.2615   61.57666    -4.55   0.000    -403.3126   -157.2103
   _Irep78_2 |   877.6347   2063.285     0.43   0.672     -3245.51     5000.78
   _Irep78_3 |   1425.657   1905.438     0.75   0.457    -2382.057    5233.371
   _Irep78_4 |   1693.841   1942.669     0.87   0.387    -2188.274    5575.956
   _Irep78_5 |   3131.982   2041.049     1.53   0.130    -946.7282    7210.693
       _cons |   10449.99   2251.041     4.64   0.000     5951.646    14948.34
------------------------------------------------------------------------------

esttab est1, cell((coef(fmt(%9.2f)) sd(fmt(%9.2f)))) label nobaselevels ///
star(* 0.10 ** 0.05 *** 0.01) stats(b r2 N) drop(_Irep78*)
coefficient _Irep78* not found
r(111);
如果使用正确的子选项
se
,代码将运行:

esttab est1, cell((coef(fmt(%9.2f)) se(fmt(%9.2f)))) label nobaselevels ///
star(* 0.10 ** 0.05 *** 0.01) stats(r2 N) drop(_Irep78*)

----------------------------------------------
                              (1)             
                            Price             
                             coef           se
----------------------------------------------
Mileage (mpg)                            61.58
Constant                               2251.04
----------------------------------------------
r2                           0.26             
N                           69.00             
----------------------------------------------
但是,子选项
coeflabels
(代码中的
coef
)应该仅 指定beta系数的标签,但不包括它们

因此,您需要使用中建议的子选项
b
@迪米特里的回答是:

esttab est1, cell((b(fmt(%9.2f)) se(fmt(%9.2f)))) label nobaselevels ///
star(* 0.10 ** 0.05 *** 0.01) stats(r2 N) drop(_Irep78*)

----------------------------------------------
                              (1)             
                            Price             
                                b           se
----------------------------------------------
Mileage (mpg)             -280.26        61.58
Constant                 10449.99      2251.04
----------------------------------------------
r2                           0.26             
N                           69.00             
----------------------------------------------
以下是
esttab
中的完整输出(不删除任何内容):