Merge single files into individual, birth, household recode [message #415] |
Wed, 08 May 2013 10:15  |
helgaurke
Messages: 5 Registered: May 2013
|
Member |
|
|
Hi,
I am currently using the PERU DHS. I have recently started using the latest round from 2009, 2010 and 2011. For these years, the data are not combined in "recode" files like the Birth, Individual and Household recodes. I have identified which files belong to the different recode files, but I have difficulties when merging these into a recode file in SPSS. Is there a special order to merge these, do some files need to be merged together first? An example is the Individual file in which the 2004-08 file has data on a range of variables for several children (marked by the sign $ in the variable name), like the birth history. When I merge the 2009 files that go into the individual recode the list of variables are included, but not the information on each child. So I am suspecting I am doing something wrong.
Any advice on this are very much welcome.
Helga
|
|
|
Re: Merge single files into individual, birth, household recode [message #460 is a reply to message #415] |
Wed, 22 May 2013 11:28  |
Bridgette-DHS
Messages: 3230 Registered: February 2013
|
Senior Member |
|
|
Here is a response from one of our DHS experts, Shea Rutstein.
The Peru data from INEI's website for 2009 and later are in SPSS data records by type of record: For women, for the birth history, for the health section, etc. To merge them together into a file like the flat file created from the CSPRO IR file. It is first necessary to change from cases to variables for the multiple section files. For example, there is an SPSS file where each birth is a case (record). This file needs to be converted back to one case per woman with different sets variables for each birth. This conversion can be done using the SPSS syntax CASESTOVARS.
For example using the file rec21.sav, First the file needs to be sorted on caseid and bidx. Then run CASESTOVARS /ID=caseid /separator="$". Finally save with a different file name such as rec21r.sav.
Do this for all the repeating sections and then use MATCH FILES with /BY caseid to add the variables from the transformed repeating sections into the woman's case. Make sure all files are sorted by caseid.
|
|
|