binscatter
binscatter copied to clipboard
faster fixed effects (or simply any regression)
-areg- is fast on Stata 12 and above (three times faster than -xtreg-), but -_regress, absorb()- is even faster. Maybe it is less able to parse some factor/time-series variable lists or there are other pitfalls, but it seems worth investigating. If the usual use case is perfectly fine with _regress, and esp. if the problematic cases are easy to identify and the user can be asked or expected to set a flag for these cases herself, _regress could be used by default.
Btw, for multiple FEs, and interactions, and group-specific trends, a speedy option seems to come from -reghdfe- on SSC.
Note though that -_regress- only allows conventional standard errors, but it can be fine for many applications/exploration. Three times faster than -regress- or -areg-.
See more about this here: http://www.statalist.org/forums/forum/general-stata-discussion/general/118137-new-command-reghdfe-available-on-ssc
@michaelstepner: I checked and I think _regress should be fine everywhere, the extra reporting and tests for areg or regress is not used by binscatter, and no vce options are allowed, I think. Also, note that a single -_regress, absorb()- would work both with and without an absorb-variable for FE: an empty option is the same as not typing it out at all.
This sounds like a good idea for an efficiency bump. I'll look into implementing it in the next version.
Yepp, this was my meaningful comment. The rest was just stream of consciousness. I am using _regress in my version, and seems to work fine.
_predict
also seems to work fine, I don't know what difference it would make.
Note the corresponding pull request: https://github.com/michaelstepner/binscatter/pull/17.