Another response from Tom Pullum:
Quote:Here is an example using the latest Egypt survey, with was an EMW survey.
set more off
use e:\DHS\DHS_data\IR_files\EGIR61FL.dta, clear
* what is the proportion of women age 20+ who had a birth before age 20?
* age at first birth is v212
* must restrict to women age 20+; say we restrict to current age 20-24
keep if v013==2
tab v212
gen teen_birth=0
replace teen_birth=1 if v212<20
gen wtt=v005*awfactt/100
svyset v021 [pweight=wtt], strata(v022)
svy: prop teen_birth
* repeat for wealth categories; must use awfactw rather than awfactt
gen wtw=v005*awfactw/100
svyset v021 [pweight=wtw], strata(v022)
svy: prop teen_birth, over(v190)
[Updated on: Thu, 17 November 2016 12:58]
Report message to a moderator