-
Notifications
You must be signed in to change notification settings - Fork 13
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
Interpreting ppmlhdfe (Poisson FE) fixed effect estimates #16
Comments
Hi Mario, Thanks for spotting this. While I don't have a full answer yet, let me tell you what I know:
With fixed effects, the constant is not materially relevant for reghdfe and ppmlhdfe, as the fixed effects made it unnecessary. For instance: sysuse auto
* Coefs are 8.711 and 8.761
glm price ibn.foreign, family(poisson) link(log) noconstant
* Replicate these numbers
ppmlhdfe price, a(FE=foreign)
replace FE = FE + _b[_cons]
tab FE Here, we can recover the same coefs as you would get with
You are correct, there seems to be a bit of numerical inaccuracy in sumFE, but I haven't been able to find any bug (yet).
Yes, that's also what I get. If I had to speculate, I think the problem might be related to inaccuracies caused by data standardization. For instance, compare the two following commands: * Default is to standardize data
sysuse auto, clear
ppmlhdfe price, a(FE=foreign) d(d) standardize_data(1)
tab FE d
sysuse auto, clear
ppmlhdfe price, a(FE=foreign) d(d) standardize_data(0)
tab FE d In the first one, there six values of I'll keep researching on this, but in the mean time, depending on your code, it might work if you disable standardization as above. Best, |
ok, thanks Sergio. That clarifies it. Cheers, Mario |
Dear Sergio, Paulo and Thomas,
I have posted this on Statalist, but GitHub might be the better place to so.
I am using your ppmlhdfe command (thanks for the time spent putting this together!)
The goal is estimating a Poisson model with many levels of fixed effects (i.e. 4 categorical variables some of which are also interacted) that fails to converge using the conventional Poisson command, or even glm .. family(Poisson).
The ppmlhdfe command works well in the sense that i) it converges and ii) it is very fast. It does so by dropping singletons/separated observations.
In the specifications where the Poisson command also converged, the point estimates are identical.
Next, I am trying to do some out of sample prediction, which the command does not allow for, so must be done manually by adding the estimated fixed effects.
Here I am having some trouble understanding the output.
Example with only one binary FE and no other covariate:
Code:
The options
absorb(..., savefe) save all fixed effect estimates with __hdfe as prefix
d(newvar) save sum of fixed effects as newvar; mandatory if running predict afterwards (except for predict,xb)
Code:
So, I don’t understand why:
__hdfe1__
estimate for each of its two values as well as an estimate for the constant. How are the values determined?__hdfe1__
andsumFE
are not the samesumFE
seems to be different for every observationCode:
Any help would be great.
The text was updated successfully, but these errors were encountered: