Comments (9)
In a way the absorb() variables take the place of the constant. On previous versions of -reghdfe- I was forcing the first absvar to be just categorical variables (no c.x) but that was because of design limitations.
One option may be to remove the -nocons- in those cases, but not sure if it's worth the coding effort (I need to modify the ivregress/ivreg2/regress/mwc wrappers).
Another would be to automatically add a constant as the first absvar.
All in all, I'm not sure. Specially because pure i.id#c.year interactions converge extremely slow in my experience. For instance, if you replace # by ## you will see that it converges in e.g. 6 iterations instead of 80.
from reghdfe.
It's definitely not worth the coding effort. It's really a unusual case - but I was misled by the result, so it seems like something should change. Catching this case to return an error, asking the user to create a cons variable sounds good. It's fairly easy to understand what happens since you don't report the cons anymore.
Just for info, you don't think reghdfe is better than reg in this case?
from reghdfe.
Makes sense, I'll just give a warning if no "fixed-intercepts" are found in absvar.
About regress vs reghdfe... the simple benchmarks I run were for fixed intercepts not fixed slopes, so I'm not sure (if you have better names to distinguish i.var from i.var##c.var let me know).
If there are only a few individuals sure regress is faster, but with 1000 or so individuals then it's likely the opposite. If you have ##c. interactions instead of #c. interactions, then reghdfe is definitely faster. If you have cluster errors then even more (which makes me wonder.. as I didn't do any optimization regarding clustered errors, so regress/areg probably had some gross inefficiencies there)
from reghdfe.
Related issue in hdfe: when I use a(var1#c.var2), I get an error telling me to add constant (exactly the kind of error reghdfe
could throw). If I do it, I get the error "idvar not found". Workaround is to add cluster(var1) so not a problem for me.
from reghdfe.
Since hdfe
is still at version 2, that behavior is expected.
What I couldn't replicate is the "idvar not found" error:
. hdfe, version
2.1.10 07apr2015
. sysuse auto
(1978 Automobile Data)
. hdfe price weight , a(turn#c.gear) gen(A_) // This fails
error parsing absorb : first absvar cannot be continuous interaction
solution: i) reorder absvars, ii) replace # with ##, iii) add a constant as first absvar (as a workaround)
. gen const = 1
. hdfe price weight , a(const turn#c.gear) gen(A_) // This works
from reghdfe.
I can't replicate it either, not sure what happened. Sorry.
from reghdfe.
Allrigh I got it!
reghdfe, version
*2.1.47 12may2015
sysuse auto, clear
gen cons = 1
reghdfe price weight , a(cons turn#c.gear turn#c.trunk)
It's actually a bug unrelated to my initial report. the following also fails:
sysuse auto, clear
reghdfe price weight , a(turn turn#c.gear)
Also note that in the reghdfe price weight , a(turn turn#c.(gear trunk))
returns an error ") required"
from reghdfe.
Matthieu,
Since this is an unexpected behavior, would it be enough if I gave a warning in case absorb() only contains fixed slopes? Maybe also allow _cons
as a magic variable in absorb(), but that may just complicate things too much.
from reghdfe.
Of course, this is great
from reghdfe.
Related Issues (20)
- Questions about the redundant FE reported and yhat predicted after running reghdfe
- [BUG] The factor varlist feature is not working in some instance of reghdfe
- Could we implement -margins- after running -reghdfe-?
- How to romove the "_cons" fixed effect in "estfe"[BUG] HOT 2
- hdfe HOT 2
- Different standard errors in reghdfe 3.2.7 versus reghdfe 5.7.3
- [BUG] Version 6.12.3 of reghdfe appears to break ppmlhdfe HOT 2
- [BUG] error occurred while loading reghdfe.ado HOT 2
- Incorrect "parentheses unbalanced" error HOT 5
- [BUG] Missing `strok` option with `nopartialout` and `varlist_is_touse` HOT 1
- [BUG] HOT 2
- Predict residual outside e(sample)
- Fail to replicate the Example: OLS regression in reghdfe_programming help file
- [BUG] Summarize Breaks and Other Mata Load Error
- [BUG] Ensure vcov matrix is symmetric to avoid numerical precision issues HOT 1
- [BUG] Neither `noregress` nor `keepmata` store `HDFE.solution`
- [BUG] Version 6.12.0 breaks ivreghdfe with "last estimates not found" HOT 6
- [BUG] Failure to generate parallel processes on remote server HOT 3
- [BUG] _assert_abort(): 3498 error partialling out; missing values found HOT 1
- [BUG] Different SE's on main regressors using time series operator in absorb() vs as "regular" control in main line HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reghdfe.