Hello,
I tired IV(2SLS) regression with STATA, but I do not know whether what I do is right or not.
Please let me know better solutions.
Fixed effects: year fixed effect and id-code fixed effect
Clustering: standard errors clustered at the region and year levels.
egen id1= group(id)
egen code1 = group(code)
egen region1 = group(region)
egen double_fixed = group(id1 code1)
egen double_cluster = group(region1 year)
1)
vreghdfe Y X1 X2 X3 (endogenous variable=instrument variable), absorb(i.year id1 code1) cluster(region1 year)
2)
vreghdfe Y X1 X2 X3 (endogenous variable=instrument variable), absorb(i.year double_fixed) cluster(double_cluster)
3)
xtset double_fixed
xtreg endogeneous_variable = Instrument_variable X1 X2 X3 i.year, fe
predict endo_var_hat, xb
xtreg Y endo_var_hat X1 X2 X3 i.year, fe
4)
xtreg endogeneous_variable = Instrument_variable X1 X2 X3 i.year, fe vce(cluster double_cluster): error - panels are not nested within clusters
Which one is correct? any better solution?
Related Posts with IV(2SLS) regression with fixed effects and two-way clustering
mvprobit or cmp?Dear STATA Users, I am trying to estimate a multivariate probit for a given outcome that would mode…
Ado embedded python code not workingI have an ado called groupfunction which made use of python for calculating Gini coefficients since …
Exporting data in excel sequentially, in different rowsHi All, I currently have data which resembles the following: Code: * Example generated by -dataex…
Sample size for one proportion (prevalence in cross-sectional design)Hello everybody, and thank you in advance. I'm trying to calculate a sample size for a cross-sectio…
The Number of Iterations for Convergence in mlI am writing a programme for the ml command. I found that even if a slight difference in my codes ca…
Subscribe to:
Post Comments (Atom)
0 Response to IV(2SLS) regression with fixed effects and two-way clustering
Post a Comment