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

Clustered standard errors #123

Closed
catabia opened this issue Apr 7, 2022 · 6 comments
Closed

Clustered standard errors #123

catabia opened this issue Apr 7, 2022 · 6 comments

Comments

@catabia
Copy link

catabia commented Apr 7, 2022

Don't think there is necessarily a bug, but I need clarification on an issue with the clustervar argument in att_gt. Docs say that you may enter a vector of up to two variables for clustering, as long as one of them is equivalent to idname. However, when I try to cluster on both state and idname (which is actually a column in my dataset that is also input as idname for the function--sorry for the confusing variable names), I get the following error:

Screenshot from 2022-04-07 13-12-15

I don't get an error when the only variable I choose is state. Is this because idname is already automatically included in the cluster?

@bcallaway11
Copy link
Owner

Yes, you are right, I think the issue is with the documentation. att_gt will automatically cluster by the "id" variable.

Brant

@catabia
Copy link
Author

catabia commented Apr 7, 2022

Hi Brant! Thanks so much for getting back to me quickly! I really appreciate how easy your package makes computing staggered DiDs. So to be absolutely sure that I understand this correctly, when I set clustervars='state', I am clustering on both idname and state? Not state instead of idname?

@pedrohcgs
Copy link
Collaborator

pedrohcgs commented Apr 7, 2022 via email

@catabia
Copy link
Author

catabia commented Apr 11, 2022

Thank you!

@catabia
Copy link
Author

catabia commented Apr 11, 2022

Another quick question. Say that the idname and the other chosen cluster variable are not nested. For instance, say I set clustervars=year. Since they are not nested, how is the cluster-robust variance matrix calculated? Is it this method:

Screenshot from 2022-04-11 11-40-00

That is to stay, adding the variance matrix for idname clusters to the variance matrix for year clusters, then subtracting the variance matrix for idname interacted with year?

@bcallaway11 bcallaway11 reopened this Apr 12, 2022
@bcallaway11
Copy link
Owner

The way we calculate clustered standard errors (both in nested and non-nested cases) are by using the multiplier bootstrap and making the "same" draw of the weights for units in the same clusters. I am not sure if this is roughly analogous to the formula that you sent.

@pedrohcgs, any comments?

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