The features of my data structure are the following:
- Individual-level data, in particular, a repeated cross-section dataset (i.e. not a panel) across many countries (variable COUNTRY)
- Dichotomous dependent variable (DV)
- Multiple scores for each individual for one independent variable (IV1 below), to various possible choices (P, ranging from 4 to 15, depending on country and year)
- ther variables defined at the individual level (e.g. see IV2)
The following table provides an idea of the data structure at hand:
ID | COUNTRY | DV | IV1 | IV2 | P |
1 | 1 | 0 | 2 | 1 | 1 |
1 | 1 | 0 | 3 | 1 | 2 |
1 | 1 | 1 | 10 | 1 | 3 |
2 | 1 | 0 | 2 | 3 | 1 |
2 | 1 | 1 | 7 | 3 | 2 |
In normal circumstances, I would estimate a three-level hierarchical logit model with IDxP-level observations nested in ID, nested in a COUTRYxYEAR indicator.
However, I only have a few observations within individuals (always less than 16) and this would not satisfy the asymptotic assumptions needed to estimate random effects in a frequentist setting.
Thus, I would like to estimate a hierarchical logit model with observations nested at the COUNTRY-YEAR level (adding a random intercept to account for this), but then I also want to account for the fact that observations are repeated within individuals introducing clustered-robust standard errors at the ID level. This way, I want to avoid unrealistic standard errors for the IV1 coefficient.
My code:
Code:
melogit DV IV1 IV2 || COUNTRY:, vce(cluster ID)
Code:
highest-level groups are not nested within ID r(459);
1) Is there some flaw in the model that I cannot see?
2) How can I estimate such a model in STATA?
Thank you all.
John
0 Response to Multilevel/Hierarchical models and clustered-robust standard errors
Post a Comment