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
[Panel Data] How can I study the way a variable in the past affected the drop in a different variable in the future.All the values that I have for the variable bondratio (amount of company debt that is in the form of…
store coefficients from different data setHi Statalist, Could anyone help me, please? I want to do a plot with coefficients from regressions …
Exporting Stata GraphI sent Stata graph as tiff to the editors of a journal but the insist they would like them in a Micr…
Convert Data in Matrix Form to Long FormatHello every one, I have data in matrix form, where there are several rows that should ideally be in…
How to calculate birth year effects?Dear friends, I hope to calculate the birthyear effects. My code is similar as below, Code: reg i…
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