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

issues with clustering - insufficient observations #36

Closed
nikhilklath opened this issue Sep 18, 2021 · 6 comments
Closed

issues with clustering - insufficient observations #36

nikhilklath opened this issue Sep 18, 2021 · 6 comments

Comments

@nikhilklath
Copy link

nikhilklath commented Sep 18, 2021

@sergiocorreia , I needed some advice on clustering while using ivreghdfe.

My code is -
ivreghdfe yvar (ever_win = true_treat), absorb(strata gender#batch city#batch yrs_school#batch age#batch mult_apply_hh#batch) vce(cluster unique_id)

I have 78,670 observations with about 42000 distinct unique_ids. The FEs in absorb() amount to about 3000 dummies.

The error I get is insufficient observations.
When I remove the vce(cluster) option, the code runs properly. Could you help out with what I must be doing wrong here?

@toyokuma
Copy link

Same problem occurred. Is there a way to figure it out? @nikhilklath @sergiocorreia Thx.

@sergiocorreia
Copy link
Owner

What do you get if you

a) Run ivreghdfe with the keepsingleton option
b) Just run the reduced form or the first stage with reghdfe?

I'm asking this because I suspect you might have insufficient observations if there are a lot of singletons.

@nikhilklath
Copy link
Author

What I found to work finally was that I unstalled all the packages (ftools, ivreghdfe, reghdfe, ivreg2) and reinstalled all of then from ssc install and not net install. My best guess was that the older version worked well and the more recent version had some change that made at least my code to not work.

@toyokuma
Copy link

toyokuma commented Nov 5, 2021

uninstall and use ssc install to install again works for me too. BTW, I didn't impose ivreghdfe to keep singletons obs. @sergiocorreia

@usewei-cell
Copy link

I also have the same issue when using ivreghdfe with the absorb and cluster options; it reports insufficient observations and no singleton. Furthermore, there is no such issue now that the cluster option has been removed.

@sergiocorreia
Copy link
Owner

Fixed by sergiocorreia/reghdfe@e73880c !

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

4 participants