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
Dyadic Ties. Looping if a pair in the same group is also a pair in another group, not longer than five years before the focal groupI am using Stata 15.0 I am trying to construct the variable Prior Tie Density (the number of formed …
Interpreting coefficients with two interaction termsHello, I have a general question about how to interpret regression coefficients, when you have more…
A question about GDP interacted with Quarter Fixed EffectsHi! What could be the idea behind interact GDP with Quarter Fixed Effects in a Difference in Differ…
xtpcse with ols coefficients and ar(1) standard errorsDear users, I have a panel with n=40 states and t=30 years which I would like to estimate with the …
Help with time-invariant variable in panel dataGood morning, I am new here and would greatly appreciate some help. I would like to run a regressio…
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