Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to suppress constant? #258

Open
toyokuma opened this issue Jul 5, 2022 · 2 comments
Open

Is there a way to suppress constant? #258

toyokuma opened this issue Jul 5, 2022 · 2 comments

Comments

@toyokuma
Copy link

toyokuma commented Jul 5, 2022

Dear Sergio,

reghdfe automatically run an OLS regression with a constant, and the current 'noconstant' option only suppresses the reporting of the constant. Is there a way to run an OLS regression without a constant? I tried to generate a constant variable, and add it into absorb(), so that the constant is absorbed. However, there is still a reported constant there.

e.g.
gen cons = 1 reghdfe y x ctrl-vars, absorb(fe-var1 fe-var2 cons)

Is there a way to run an OLS regression without a constant?

Thanks!
Toyo

@sergiocorreia
Copy link
Owner

Hi Toyo,

reghdfe doesn't include constants in the traditional sense, but any model with FEs implicitly has a constant, as the constant can be reproduced as the sum of all the dummies underlying the fixed effect. For instance, if you have country FEs then adding the dummies of each of the countries would give you a vector of 1s.

What reghdfe does is the back-off the constant from the average of the first fixed effect. However, I wonder what exactly are you trying to achieve? EG if in your example you put "cons" first in absorb() then you might be able to do what you are intending.

@haoranliu666
Copy link

I'm facing the same issue here.
In a event study setting, where the variables or interest are saturated, using the normal regress, I can discard the constant:

reg y minus3 minus2 minus1 plus0 plus1 plus2 plus3, noconstant

But in reghdfe, the noconstant simply does not report constant, and the estimation of post_plus3 will be automatically dismissed.

reghdfe y minus3 minus2 minus1 plus0 plus1 plus2 plus3, noabsorb noconstant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants