From ee2ee1743da3d05cb74a2e69092dc7fc811c8df4 Mon Sep 17 00:00:00 2001 From: Sergio Correia Date: Thu, 26 Oct 2017 13:17:24 -0400 Subject: [PATCH] (major) Fixed bug in -summarize- option Before, we were using the entire dataset (!) to compute the summary statistics; now we only use the regression sample (which also excludes dropped singleton observations). --- src/reghdfe.ado | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/reghdfe.ado b/src/reghdfe.ado index 49d4482..2186cef 100644 --- a/src/reghdfe.ado +++ b/src/reghdfe.ado @@ -1,4 +1,4 @@ -*! version 4.4.10 10oct2017 +*! version 4.4.11 26oct2017 program reghdfe, eclass * Intercept old+version @@ -351,7 +351,7 @@ program Estimate, eclass * Stats mata: st_local("stats", HDFE.summarize_stats) - if ("`stats'" != "") Stats + if ("`stats'" != "") Stats `touse' * Condition number mata: HDFE.estimate_cond() @@ -459,6 +459,7 @@ end program Stats + args touse * Optional weights mata: st_local("weight", sprintf("[%s=%s]", HDFE.weight_type, HDFE.weight_var)) assert "`weight'" != "" @@ -470,6 +471,6 @@ program Stats mata: st_local("cvars", invtokens(HDFE.cvars)) loc full_varlist `varlist' `cvars' - qui tabstat `full_varlist' `weight' , stat(`stats') col(stat) save + qui tabstat `full_varlist' if `touse' `weight' , stat(`stats') col(stat) save matrix reghdfe_statsmatrix = r(StatTotal) end