Hello, I am a political science graduate student, new to the Stata Forum and a first time poster. I am working on a project where I want to run a multilevel model using weighted survey data, but I am running into some issues with which I would greatly appreciate some help.
The data I am using is a national survey with final sample weights (
weight) available that take into account the survey’s design effect. For each respondent, I created an “ideological distance” variable (ideo), which is how far away ideologically the respondent is from their member of Congress. For example, if a respondent is very liberal, and her Congressperson is very conservative,
ideo would be a very big number.
Ideo would be a very small number if they are both very liberal. The model I want to run would, in addition to having other variables, assess the impact of ideo on the likelihood that the respondent approves of their Congressperson (
approve – a binary variable). Further, I want to look at only subsets of respondents – specifically, looking at one model including only Democrats, and one model including only Republicans.
The data is hierarchical - with the
ideo variable, multiple respondents often come from the same Congressional district (
district) and have the same member of Congress, so they are not completely independent). Because of this, I’d like to use a multilevel mixed effects model. However, when I run a survey-weighted model that tries to incorporate this hierarchy, this is the output I get:
svyset [pweight=weight]
svy, subpop(democrats): melogit approve ideo || :
(running melogit on estimation sample)
survey final weights not allowed with multilevel models;
a final weight variable was svyset using the [pw=exp] syntax, but multilevel models require that each stage-level
weight variable is svyset using the stage's corresponding weight() option
I can't provide a district-level weight, though, because a) the survey did not do any stage of sampling at the district level, and b) all I have is final weights. One solution I thought about was to create a weight variable equal to one for Congressional districts, and incorporate that into the svyset command, as such:
gen x = 1
svyset district, weight(x) || _n, weight(weight)
svy, subpop(democrat): melogit approve ideo || district:
Here, I get output that makes some sense, but does running a model like this incorporate the final sample weights correctly? To me, it logically seems like it would, but it's not an assumption I would want to make without asking people smarter than me
![Smile]()
Is this a correct way to account for district-level effects while still applying survey weights correctly? If not, how could I account for the hierarchical nature of the data while still applying these final, respondent-level weights correctly? Any advice or thoughts would be helpful; thanks!
- Ryan Strickler