使用estfe删除指标

时间:2017-06-06 10:55:29

标签: stata

当使用estfe和随后的indicate(r(indicate_fe))时,回归表包含所有的固定效果设置,即使我没有在{{1}中指定它们},似乎无法放弃它们。

在以下示例中,我想控制estfeheadroom,但只显示foreign,我将其重命名为headroom

foo

显然,. sysuse auto, clear (1978 Automobile Data) . reghdfe price weight, a(headroom foreign) (dropped 1 singleton observations) (converged in 4 iterations) HDFE Linear regression Number of obs = 73 Absorbing 2 HDFE groups F( 1, 64) = 64.50 Prob > F = 0.0000 R-squared = 0.5542 Adj R-squared = 0.4985 Within R-sq. = 0.5020 Root MSE = 2095.7886 ------------------------------------------------------------------------------ price | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- weight | 3.58106 .4458786 8.03 0.000 2.690315 4.471805 -------------+---------------------------------------------------------------- Absorbed | F(7, 64) = 5.272 0.000 (Joint test) ------------------------------------------------------------------------------ Absorbed degrees of freedom: ---------------------------------------------------------------+ Absorbed FE | Num. Coefs. = Categories - Redundant | -------------+-------------------------------------------------| headroom | 7 7 0 | foreign | 1 2 1 | ---------------------------------------------------------------+ . eststo m: reghdfe price weight, a(headroom foreign) (dropped 1 singleton observations) (converged in 4 iterations) HDFE Linear regression Number of obs = 73 Absorbing 2 HDFE groups F( 1, 64) = 64.50 Prob > F = 0.0000 R-squared = 0.5542 Adj R-squared = 0.4985 Within R-sq. = 0.5020 Root MSE = 2095.7886 ------------------------------------------------------------------------------ price | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- weight | 3.58106 .4458786 8.03 0.000 2.690315 4.471805 -------------+---------------------------------------------------------------- Absorbed | F(7, 64) = 5.272 0.000 (Joint test) ------------------------------------------------------------------------------ Absorbed degrees of freedom: ---------------------------------------------------------------+ Absorbed FE | Num. Coefs. = Categories - Redundant | -------------+-------------------------------------------------| headroom | 7 7 0 | foreign | 1 2 1 | ---------------------------------------------------------------+ . estfe m, labels(headroom "foo") . return list macros: r(indicate_fe) : " "foo=0.headroom" "foreign=0.foreign"" . esttab m, keep(weight) indicate(`r(indicate_fe)') ---------------------------- (1) price ---------------------------- weight 3.581*** (8.03) foo Yes foreign Yes ---------------------------- N 73 ---------------------------- t statistics in parentheses * p<0.05, ** p<0.01, *** p<0.001 . esttab m, keep(weight) indicate(`r(indicate_fe)') drop(foreign) coefficient foreign not found 仍然在回归表中,尽管我努力放弃它或不显示它。 foreign没有任何用处,所以我担心自己被卡住了。

1 个答案:

答案 0 :(得分:1)

看起来您想要包含r(indicate_fe),而不是包含displayName = coefficientName,所以在上面和下面的示例中,return list显示:

r(indicate_fe) : " "headroom=0.headroom" "foreign=0.foreign""

所以我们指出foo = 0.headroom

使用您的示例:

sysuse auto, clear
eststo m: reghdfe price weight, a(headroom foreign)
estfe m
return list
esttab m, keep(weight) indicate("foo = 0.headroom")

这将输出:

----------------------------
                      (1)   
                    price   
----------------------------
weight              3.581***
                   (8.03)   

foo                   Yes   
----------------------------
N                      73   
----------------------------
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001