Say your data is at individual level, instrument and independent variable at city level, data on 2 years, t and t+1. If you want to include city and year fixed effects, city-year fixed effects, and cluster SE on city year, what should be the code. xi: ivreg would not let me do a GMM or specify MLE stuff like ivreg 2sls does. If I use xtivreg it does not allow me to cluster SE with fe option I guess, nor does it love my i.year*i.city sort of syntax.
I want to run either some sort of this command:
egen cityear=group(city year)
xtivreg y i.year i.city i.city*i.year w u v (x=z ), fe cluster(cityear)
or
ivregress 2sls y i.year i.city i.city*i.year w u v (x=z ), fe cluster(cityear)
Can someone please tell me the appropriate code?
and I have another issue, when my data is xtset at individual id-year xtivreg returns the following error:
the sample specifies cross-sectional data
xtivreg is not designed for cross-sectional data
use ivregress with cross-sectional data
Related Posts with Individual level data, Clustering Standard Error at city level, IV regression need syntax help
Asymptomatic/Finite Sample analysisThis may not be the forum for this- perhaps Cross- Validated, but I don't have a Stata question as m…
Bootstrapped hierarchical regression?Hi! I'm trying to run a bootstrapped hierarchical regression but it doesn't seem to be working for m…
Removing Leading and Trailing SpacesConsider the following full worked example Code: import delimited "http://qed.econ.queensu.ca/jae/d…
Error when run heatplot with "function drop() not declared in class ColrSpace (120 lines skipped) " Code: ssc install heatplot Code: ssc install palettes, replace Code: ssc install colrspace, repla…
reshape errorDear Stata users, I am facing problem with -reshape wide- command. More specifically, I would like …
Subscribe to:
Post Comments (Atom)
0 Response to Individual level data, Clustering Standard Error at city level, IV regression need syntax help
Post a Comment