Hi
I am working on svyset for a multilevel model that accounts for individuals clustered within countries. I am using cross-sectional data from European Social Survey (ESS) round 7. I've spent quite some time on understanding how to -svyset- data for valid inference. I am still somewhat uncertain about my strategy and comments are welcome.
I have merged round 7 with the corresponding sampling data file found here. I have the following sample data variables:
To -svyset- for multilevel, the procedure on this Stata page looks intuitive, i.e. individuals within schools:
I am not sure how this translates to the multilevel structure in my data with individuals within countries. I have tried:
I am uncertain about this specification, and when I run a multilevel model with the -svy:- prefix, I find it a bit odd that some estimates are not reported (included variables in model not meant to make sense as I am just testing for potential errors here):
(Note: This is a slightly edited repost from another thread as I thought this question was on a different topic than the original post. I have done some research on this topic and thought this post might be of relevance to other people with similar aims. Related post on weighting multilevel models with ESS here)
I am working on svyset for a multilevel model that accounts for individuals clustered within countries. I am using cross-sectional data from European Social Survey (ESS) round 7. I've spent quite some time on understanding how to -svyset- data for valid inference. I am still somewhat uncertain about my strategy and comments are welcome.
I have merged round 7 with the corresponding sampling data file found here. I have the following sample data variables:
- Primary sampling unit: the primary sampling unit within which the respondent was selected.
- Domain: Some countries use a different sample design in each of two or more parts of the country.
- Stratum: All except three of the 21 countries participating in ESS7 used some form of stratified sampling at the first stage of selection.
- Prob: the unscaled sample selection probability of the respondent (used for dweight).
- Design weight (dweight) to correct for varying probability of selection into sample due to sampling design
- Post-stratification weights (pspweight) to reduce potential sampling error and non-response.
- Population weight (pweight) to correct for country variation when comparing two or more countries.
To -svyset- for multilevel, the procedure on this Stata page looks intuitive, i.e. individuals within schools:
Code:
svyset school_id, weight(wt_school) || _n, weight(wt_student)
Code:
. svyset country, weight(pweight) || idno, weight(dweight) Note: Stage 1 is sampled with replacement; further stages will be ignored for variance estimation. pweight: <none> VCE: linearized Single unit: missing Strata 1: <one> SU 1: country FPC 1: <zero> Weight 1: pweight Strata 2: <one> SU 2: idno FPC 2: <zero> Weight 2: dweight
Code:
. svy: mepoisson dvrcdeva gndr || country:, irr (running mepoisson on estimation sample) Survey: Mixed-effects Poisson regression Number of strata = 1 Number of obs = 39,895 Number of PSUs = 21 Population size = 34,913.011 Design df = 20 F( 0, 20) = . Prob > F = . ------------------------------------------------------------------------------ | Linearized dvrcdeva | IRR Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- gndr | .9908461 . . . . . _cons | 1.885248 . . . . . -------------+---------------------------------------------------------------- country | var(_cons)| 561179.7 . . . ------------------------------------------------------------------------------ Note: Estimates are transformed only in the first equation. Note: _cons estimates baseline incidence rate (conditional on zero random effects).
(Note: This is a slightly edited repost from another thread as I thought this question was on a different topic than the original post. I have done some research on this topic and thought this post might be of relevance to other people with similar aims. Related post on weighting multilevel models with ESS here)
Comment