Dear all,
I am currently running a DiD set-up on panel data.
The panel is made of school (PC) and years. I would like to have an iteration with errors clustered at the school level, and one with errors clustered at the school-year level.
My understanding is that with CSDiD when Panel estimators are used,standard errors are already clustered at the panel level. Does it make the use of "cluster(pc)" (please see code below) superfluous?
Further, the help file says " When using cluster, one is effectively requesting a two-way cluster estimation." However when I call for "cluster(year)" it also does not run.
Specifically:
I am not sure what I am doing wrong or if it is at all possible to have a double clustering with CSDID or did_multiplegt_dyn. Could someone help me?
Thank you very much in advance!
Best,
Ludovica
I am currently running a DiD set-up on panel data.
The panel is made of school (PC) and years. I would like to have an iteration with errors clustered at the school level, and one with errors clustered at the school-year level.
My understanding is that with CSDiD when Panel estimators are used,standard errors are already clustered at the panel level. Does it make the use of "cluster(pc)" (please see code below) superfluous?
Further, the help file says " When using cluster, one is effectively requesting a two-way cluster estimation." However when I call for "cluster(year)" it also does not run.
Specifically:
Code:
xtset pc year csdid log_grade, ivar(pc) time(year) gvar(year_of_treat) ## This runs csdid log_grade, ivar(pc) time(year) gvar(year_of_treat) cluster(pc) ## This gives the following error: pc may not be both target and by() r(198); csdid log_grade , ivar(pc) time(year) gvar(year_of_treat) cluster(year) ## This gives the following error: panels are not nested within clusters r(498); did_multiplegt_dyn log_grades pc year iv, effects(8) placebo(5) cluster(pc) ## This runs xtset pc year egen double_cluster=group(pc year) did_multiplegt_dyn log_grades pc year iv, effects(8) placebo(5) cluster(double_cluster) ## This doesn't run: "The group variable should be nested within the clustering variable."
Thank you very much in advance!
Best,
Ludovica
Comment