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

clustering by categorical variable #287

Open
aferrari0 opened this issue Sep 2, 2024 · 0 comments
Open

clustering by categorical variable #287

aferrari0 opened this issue Sep 2, 2024 · 0 comments
Assignees

Comments

@aferrari0
Copy link

aferrari0 commented Sep 2, 2024

I have recently updated ivreghdfe, ftools as well as reghdfe.

With the older versions, I had been successfully running panel IV regressions of the type

ivreghdfe y (x=z), absorb(id) cluster(id)

where id is the variable of the panel identifier. Importantly, id is a string variable.

I have 32,251 observations and 2,329 different id values.

ivreghdfe (only after my recent update) started giving me the following error

insufficient observations
r(2001);

This only happens when estimating the regression above. If I encode the id variable

encode id, gen(id_code)

and estimate

ivreghdfe y (x=z), absorb(id) cluster(id_code)

or

ivreghdfe y (x=z), absorb(id_code) cluster(id_code)

the regressions work, and I get the same results as before the update.

For context, clustering by the original string variable does not seem to be a problem in reghdfe.

Best

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

2 participants