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 #4169 is a reply to message #4080] Sat, 11 April 2015 17:43 Go to previous messageGo to previous message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 803
Registered: January 2013
Senior Member
Try the following:
* Open wealth index data file.
get file="ETWI41FL.SAV".
* Sort cases by ID.
sort cases by WHHID.
* Save the  sorted wealth index data file.
save outfile="ETWI41FL.SAV".

* Open women's recode file.
get file="ETIR41FL.SAV".
* Create matching ID variable.
string WHHID (A12).
compute WHHID = substr(CASEID, 1, 12).

* Sort cases by ID.
sort cases by CASEID.

* Match files wealth index data to individual recode data.
match files /file=*
  /table="ETWI41FL.SAV"
  /by WHHID.
execute.

 
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 15:53:16 Coordinated Universal Time 2024