Skip to content

Commit

Permalink
(major) Fixed bug in -summarize- option
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
sergiocorreia committed Oct 26, 2017
1 parent 96ab65a commit ee2ee17
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/reghdfe.ado
@@ -1,4 +1,4 @@
*! version 4.4.10 10oct2017
*! version 4.4.11 26oct2017

program reghdfe, eclass
* Intercept old+version
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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'" != ""
Expand All @@ -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

0 comments on commit ee2ee17

Please sign in to comment.