The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use in Stata » HELP!: Analysis on youth-specific age group only
Re: HELP!: Analysis on youth-specific age group only [message #1816 is a reply to message #1798] Thu, 03 April 2014 17:25 Go to previous message
user-rhs is currently offline  user-rhs
Messages: 132
Registered: December 2013
Senior Member
svyset should be executed before you run tabulations, regressions, etc. It's a matter of preference, really. I typically do svyset at the top of my do-file, right after I create the wgt variable by dividing v005 by 100000 (or as instructed by the DHS final report).

After you run svyset, anything you run with the svy prefix will use the svyset that you specified. If you want to change the specification of svyset, you can do svyset,clear and then re-specify svyset with the new settings.

The svy prefix is done with the command you are trying to execute. So for example if you want to cross-tabulate, do svy: tab variable1 variable2, col. I see you are trying to do the tabs by categories of the variable 'age in 5 year groups.' I don't think you can combine svy with by, so you can just tab for the subpop of interest (the different levels of mv013):

svy: tab mv102 mv149 if mv013==1,col
svy: tab mv102 mv149 if mv013==2,col
svy: tab mv102 mv149 if mv013==3,col
...
and so on.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Missing data
Next Topic: browsing data
Goto Forum:
  


Current Time: Sun Nov 24 19:28:10 Coordinated Universal Time 2024