Hi there,
First off, thank you for taking your time to read through my question.
I have a panel data, which id is facility and time is year. It is an unbalanced panel of 25 years.
I am running panel fixed effect regression with year and industry fixed effects controlled for.
I have coded district and state of the facility location. Since each district / state may influence facility performance, I am wanting to cluster by district or by state.
Facility does not move district or state.
I have a following questions:
1) When I ran xtreg y X_i, i.year i.industry, fe vce(cluster state_abbreviation), where state_abbreviation is a string variable with abbreviated state name, e.g. "NY", "CA." The code would run fine and I would get clustered standard error.
However, when I run the code xtreg y X_i i.year i.industry fe vce(cluster state_id), where state_id is a state code ranging from 1 to 56 e.g. Alabama = 1, Alaska =2, I get an error message panels are not nested within clusters.
If anything, I had expected string variable clustervar would give an error, but not the integer clustervar, but while I can run cluster standard error with state_abbreviation, I cannot with state_id.
Has anyone experienced this? What might be the cause of this?
2) Likewise, when I tried to cluster by district of the state by using "district_state" (3 or 4 digit integer) created by egen district_state = concat (district state_id), I also get panel not nested within clusters.
In sum, what would be the cause of such error? Is unbalanced panel be the cause? Or does it have to do with some state/ district over-represented?
3) Lastly, do I even need clustered standard error? Could I say that since I am using panel fixed effect and all my facilities do not move in location, fixed effect would control for heterogeneity from location (district | state). Hence, if I do fixed effect and clustering, there is a redundancy?
My conceptualization of clustering may be completely off. This concept never clicked to me..
Your thoughts and feedback would be greatly appreciated.
Thank you for your time.
Please let me know if anything is unclear and I would be happy to elaborate.
Best.
DH
Related Posts with Panel Fixed Effect, Clustering Standard Error (Panels are not nested within clusters)
How to create an index variable and analyze i vs. i - 1 (long data)How could I create a variable called test_index to enumerate (from 1 to ...) the tests for each reco…
Mata - large matrix - error r(3900)Hello everyone, I am trying to run a robustness check on a weighted index for 11 countries. The fra…
Graphs for Difference-in-Difference estimationI have a pooled cross-section dataset of 788 firms for the period of 2006-2017. There was an exogeno…
ml model with panel data and misclassification error in binary choice modelDear all, I'm trying to implement Hausman et al (1998) misclassification error for binary choice mo…
Common Method BiasDear all, I would like to check likely common method bias in my survey data (using Stata's SEM modu…
Subscribe to:
Post Comments (Atom)
0 Response to Panel Fixed Effect, Clustering Standard Error (Panels are not nested within clusters)
Post a Comment