The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » Uganda » Wealth Index - Uganda 2000
Re: Wealth Index - Uganda 2000 [message #11256 is a reply to message #11196] Wed, 23 November 2016 18:23 Go to previous messageGo to previous message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 669
Registered: January 2013
Senior Member
I'm wondering if you have a problem with the way v190 is merged into your dataset. The copy of the dataset I have here does not include v190, but instead it needs to be merged from a file of wealth quintiles. Here is my code:
* Merge the wealth index into the dataset
use "C:\Data\DHS_Stata\UGKR41FL.DTA", clear
gen whhid = substr(caseid,1,12)
merge m:1 whhid using "C:\Data\DHS_Stata\UGWI41FL.dta"
keep if _merge==3
clonevar v190=wlthind5 

* generate a weight variable and tabulate as in the table
gen wt=v005/1000000
* treat the few missing cases as No for doctor
replace m3a = 0 if m3a == .
* tabulate
tab v190 m3a [iw=wt],m row

* now using svy:prop, taking stratification into account
egen stratum=group(v024 v025)
svyset v021 [pweight=wt], strata(stratum)
svy:prop m3a, over(v190)

The tab and svy:prop command produce results that match the table in the report.

[Updated on: Wed, 23 November 2016 18:34]

Report message to a moderator

 
Read Message
Read Message
Read Message
Previous Topic: Number of eligible children for height and weight/sampling procedure
Next Topic: 2011 stata data file
Goto Forum:
  


Current Time: Mon Oct 14 00:27:24 Eastern Daylight Time 2019