The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Weighting data » Adjusting survey weights in melogit in Stata
Adjusting survey weights in melogit in Stata [message #23634] Sat, 23 October 2021 11:25 Go to next message
Asantie is currently offline  Asantie
Messages: 3
Registered: October 2021
Member
Hi DHSers,

I am currently using Ethiopian DHS 2016 data to examine predictors of institutional delivery

Based on IR data, I have created necessary dependent (outcome) and independent variables (varlist). In the analysis I would like to consider the complex survey design nature of DHS survey and used the following STATA code:



gen female_wgt= v005 /1000000


svyset v021 [pw=female_wgt], strata(v023)
svy: melogit outcome varlist if ANC_use==1 || v001:


But I received the following error message:

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 an error occurred when svy executed melogit"


I think the problem is with the code I used to specify "pw" or "weight" Could you please help me how I need to write the command for svyset and svy with proper weight code????


Many thanks in advance
Asantie

[Updated on: Sat, 23 October 2021 11:27]

Report message to a moderator

Re: Adjusting survey weights in melogit in Stata [message #23640 is a reply to message #23634] Mon, 25 October 2021 10:37 Go to previous messageGo to next message
Shireen-DHS is currently offline  Shireen-DHS
Messages: 140
Registered: August 2020
Location: USA
Senior Member
Hello Asanti,

The problem is that you are fitting a multi-level model using one weight. For multi-level models you need to supply a weight for each level.

Using the svyset you provided you could fit the following model:

svy: logit outcome varlist if ANC_use==1

If you want to use multi-level weights, you need to construct the second level weight which is not available in our datasets. To do this you can check our methodological report #27: https://www.dhsprogram.com/publications/publication-mr27-met hodological-reports.cfm?csSearch=381803_1

Best,
Shireen Assaf
The DHS Program
Re: Adjusting survey weights in melogit in Stata [message #23648 is a reply to message #23640] Tue, 26 October 2021 10:03 Go to previous messageGo to next message
Asantie is currently offline  Asantie
Messages: 3
Registered: October 2021
Member
Dear Shireen,

Thank you for your suggestion. I am interested to fit multilevel model.
Unfortunately, I am still confused with the instruction provided in the manual you stated.
Could you please provide me the codes that I need to use in order to create second level weight and how to write the final model that will contain two weights? I am using the 2016 DHS women record (IR) data file.

Best regards
Asantie
Re: Adjusting survey weights in melogit in Stata [message #23649 is a reply to message #23648] Tue, 26 October 2021 10:07 Go to previous message
Shireen-DHS is currently offline  Shireen-DHS
Messages: 140
Registered: August 2020
Location: USA
Senior Member
Hello,

The Stata code is provided in the report in Appendix B using Zimbabwe as an example. The report gives detailed instructions. You will need to use the Final report for the survey you are working on and fill in the required numbers from Appendix A. We cannot provide complete the exercise for your specific survey. Please read the instruction and example code to adapt to your survey.

Best,
Shireen Assaf
The DHS Program
Previous Topic: PSU and Uganda IR data
Next Topic: Create a variable using Percentage from cross tabulation
Goto Forum:
  


Current Time: Sun Nov 3 07:38:18 Coordinated Universal Time 2024