The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Weighting data » Generating new variables in dataset with weighting
Generating new variables in dataset with weighting [message #4043] Fri, 20 March 2015 10:44 Go to next message
Lizzynaija is currently offline  Lizzynaija
Messages: 12
Registered: February 2015
Location: United States

I have been working with the 2013 Nigeria DHS births recode dataset, using Stata for my analysis.

I have applied svyset to enable weighting in the analysis. After reading the Stata manual, I became confused as to how to generate new variables now that I have applied svyset command. In particular, I am not sure about when to apply the svy subpop command.

Can I still use the regular "generate" command to create new variables, and when and how should I apply the "svy subpop" command?

Thank you very much,
Re: Generating new variables in dataset with weighting [message #4119 is a reply to message #4043] Thu, 02 April 2015 08:17 Go to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 2549
Registered: February 2013
Senior Member
Following is a response from Senior DHS Stata Specialist, Tom Pullum:

If you redefine any of the variables that are used in an svyset command, after specifying svyset, I would recommend that you re-set svyset, even if the command would be exactly the same. However, I don't know for sure that it's necessary. You could easily check by doing two runs, one with a repeat of svyset and one without, to see whether the results are affected. In general, I prefer to put svyset after any recoding and as close to the estimation commands as possible, just to make it easier to read what the model is.

Previous Topic: De-normalizing and weighting data for multiple countries
Next Topic: v022, mv022, hv022 (the sample strata variables) in 2003 Burkina Faso stata dataset
Goto Forum:

Current Time: Sun Aug 14 08:08:00 Coordinated Universal Time 2022