I'm trying to extract coefficients, standard errors and p-values from a a regression run with ivreghdfe. With the standard reghdfe, it's easy enough:
But r(table) doesn't exist when using ivreghdfe. I think in part this is because ivreghdfe is a version of ivreg2. One can extract the first stage from ivreg2 like so:
When replacing
with
to get the first stage, stata tells me the _ivreg2_price is not found. Is there an easy way to extract model statistics from ivreg2 and ivreghdfe that I'm not seeing?
Code:
reghdfe price mpg weight, noabsorb (MWFE estimator converged in 1 iterations) HDFE Linear regression Number of obs = 74 Absorbing 1 HDFE group F( 2, 71) = 14.74 Prob > F = 0.0000 R-squared = 0.2934 Adj R-squared = 0.2735 Within R-sq. = 0.2934 Root MSE = 2514.0286 ------------------------------------------------------------------------------ price | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- mpg | -49.51222 86.15604 -0.57 0.567 -221.3025 122.278 weight | 1.746559 .6413538 2.72 0.008 .467736 3.025382 _cons | 1946.069 3597.05 0.54 0.590 -5226.245 9118.382 ------------------------------------------------------------------------------ . mat OUTPUT = r(table) . mat li OUTPUT OUTPUT[9,3] mpg weight _cons b -49.512221 1.7465592 1946.0687 se 86.156039 .64135379 3597.0496 t -.57468079 2.7232382 .54101802 pvalue .56732373 .00812981 .59018863 ll -221.30248 .46773602 -5226.2445 ul 122.27804 3.0253823 9118.3819 df 71 71 71 crit 1.9939434 1.9939434 1.9939434 eform 0 0 0
But r(table) doesn't exist when using ivreghdfe. I think in part this is because ivreghdfe is a version of ivreg2. One can extract the first stage from ivreg2 like so:
Code:
sysuse auto ivreg2 price (mpg=weight), savefirst estimates replay _ivreg2_mpg mat l r(table)
When replacing
Code:
estimates replay _ivreg2_mpg
Code:
estimates replay _ivreg2_ price
Comment