2017-06-06 333 views
1

當使用estfe和隨後indicate(r(indicate_fe)),迴歸表包含所有設置的固定效應,即使我沒有在estfe中指定它們,並且似乎沒有辦法放棄它們。下降指標與estfe

在下面的例子,我想控制headroomforeign,但只顯示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仍處於迴歸表,儘管我最難的努力放棄或不顯示它。 help estfe沒有任何用處,所以恐怕我被卡住了。

回答

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