The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Merging data files » merging height weight file to children's file in SPSS
Re: merging height weight file to children's file in SPSS [message #4166 is a reply to message #4157] Sat, 11 April 2015 16:43 Go to previous message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 805
Registered: January 2013
Senior Member
You can use code like the following to match the height and weight data to the Children's Recode (KR) file:

* Open Height and weight data file.
GET FILE='ZWHW51FL.SAV'.
* Sort the file.
SORT CASES BY HWHHID, HWLINE.
* Save the sorted data file.
SAVE OUTFILE='ZWHW51FL.SAV'.

* Open Child's recode data.
GET FILE='ZWKR51FL.SAV'.
* Create matching ID variables.
STRING HWHHID (A12).
COMPUTE HWHHID = SUBSTR(CASEID, 1, 12).
* Sort the data file on the matching fields.
SORT CASES BY HWHHID, B16.

* Match the HW file to the KR file.
MATCH FILES /FILE=*
  /TABLE='ZWHW51FL.SAV'
  /RENAME HWLINE=B16
  /BY HWHHID, B16.


Note that this code works when you are matching height and weight data collected at the household level with the children's recode (KR) file. There are two other variations that exist - matching height and weight data collected at the household level with the children's data in the Person's Recode (PR) file; and matching data collected at the individual level with the children's recode (KR) file (used in the earlier DHS surveys). These other variations require somewhat different approaches. The document merge.doc that is distributed with the HW data files describes each approach.
  • Attachment: MERGE.DOC
    (Size: 41.00KB, Downloaded 857 times)
 
Read Message
Read Message
Previous Topic: merging different countries data
Next Topic: Merging Hiv Women Men and Couples
Goto Forum:
  


Current Time: Fri Jan 10 08:16:44 Coordinated Universal Time 2025