The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use in Stata » merging wealth index from Ethiopia DHS 2000 to women's file
Re: merging wealth index from Ethiopia DHS 2000 to women's file [message #678 is a reply to message #661] Mon, 12 August 2013 12:21 Go to previous messageGo to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3202
Registered: February 2013
Senior Member
Following is an example syntax for merging the wealth index with the women. You can use this, and just change the women's variable names to the men's variable names.

GET
FILE='C:\et\ETWI41FL.SAV'.

SORT CASES BY
whhid (A) .

SAVE OUTFILE='C:\et\wisort.sav'
/RENAME(WHHID=
HHID)
/COMPRESSED.

GET
FILE='C:\et\ETIR41FL.SAV'.

STRING hhid (A12).
COMPUTE hhid = SUBSTR(caseid,1,12) .
VARIABLE LABELS hhid 'hhid' .
EXECUTE .

SORT CASES BY
hhid (A) .

SAVE OUTFILE='C:\et\WOMENSORT.SAV'
/COMPRESSED.

MATCH FILES /FILE=*
/TABLE='C:\et\wisort.sav'
/BY hhid.
EXECUTE.

SAVE OUTFILE='C:\et\WI_IR.SAV'
/COMPRESSED.
COMPUTE wt = v005 / 1000000 .
EXECUTE .
WEIGHT
BY wt .
 
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: Hypertension in Nepal
Next Topic: Keeping caseid in and keeping missing observations out when using Stata "collapse"
Goto Forum:
  


Current Time: Mon Dec 2 16:37:10 Coordinated Universal Time 2024