The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Merging data files » Merging datasets for different countries on SPSS
Merging datasets for different countries on SPSS [message #17446] Tue, 19 March 2019 20:40 Go to next message
nicolegray1 is currently offline  nicolegray1
Messages: 1
Registered: February 2019
Member
I'm analysing secondary sex ratio trends in 14 different African countries using DHS data and chi-square tests of association for 8 variables for each . However the results are very inconsistent and this may be because the sample size is too small for individual countries; it must supposedly be at least 1 million births. Therefore, as I've seen other studies do, I wanted to combine the data for the 14 countries and rerun my chi-square tests on the same variables, to see what associations hold when the data is aggregated. Does anyone know how I can merge these different datasets so that they are in one dataset- copy and pasting the data just crashes my laptop as the files are too large.

Thanks in advance.
Re: Merging datasets for different countries on SPSS [message #17479 is a reply to message #17446] Thu, 28 March 2019 11:29 Go to previous messageGo to next message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3016
Registered: February 2013
Senior Member

Following is a response from Senior DHS Stata Specialist, Tom Pullum:

You are talking about appending data files rather than merging. There have been many forum postings on this topic, mostly using Stata rather than SPSS.

Why do you think you need "at least 1 million births"? You could definitely analyze the sex ratio at birth (I think "at birth" is what you are talking about) using the BR files for specific countries. It is NOT necessary to pool or append the files. The sex of the child is given as b4, with 1=boy and 2=girl. You could, for example, recode this into a 0/1 variable and use logit regression. I suggest that you start with a search of what other researchers may have done with the sex ratio and DHS data.
Re: Merging datasets for different countries on SPSS [message #17581 is a reply to message #17446] Fri, 19 April 2019 16:55 Go to previous messageGo to next message
boyle014 is currently offline  boyle014
Messages: 78
Registered: December 2015
Location: Minneapolis
Senior Member
Dr. Pullman is correct that it may not be necessary to append all these files to accomplish your goals. However, if you do decide that you want to append many files, while retaining just a few variables, you should think about using IPUMS DHS. IPUMS DHS allows you to select the samples and variables that interest you, and download a single, fully harmonized and integrated data file. Here is the online user guide to help you get started. Since you are using SPSS, be sure to change the data format to SPSS when you are checking out.

Professor Elizabeth Boyle
Sociology & Law, University of Minnesota, USA
Principal Investigator, IPUMS-DHS
Re: Merging datasets for different countries on SPSS [message #28724 is a reply to message #17446] Thu, 29 February 2024 07:18 Go to previous message
deng222 is currently offline  deng222
Messages: 1
Registered: February 2024
Location: New York
Member
Hello,
Here is how to achieve this.
Open Your Main Dataset: Start SPSS and open one of the datasets you want to merge.

Merge Files:

Go to the Data menu, select Merge Files, and then choose Add Cases... if you want to append the datasets (i.e., add rows/cases).
If instead, you are looking to add variables (i.e., add columns) from another dataset that matches cases on some identifier, you would select Add Variables....
Select the File to Merge:

For Add Cases, a dialog box will prompt you to select the file you want to append to the currently opened dataset. Navigate to the file, select it, and click Open.
For Add Variables, you will also need to specify the matching variable(s) in both datasets (the variable that identifies the same cases in both files).
Review and Adjust:

Add Cases: You'll have the opportunity to review the cases to be added. SPSS will attempt to match variables by name. Ensure that the variables intended to match between the datasets are correctly aligned.
Add Variables: You must ensure that the matching variables correctly align between your datasets and review how SPSS proposes to merge the additional variables.
Execute the Merge:

Follow through the dialog boxes, adjusting options as necessary. For appending cases, you might not need to do much more. For adding variables, ensure you've correctly identified the matching variables.
Finalize the merge process. SPSS will then append the dataset or add the variables as specified.
Save the Merged Dataset:

It's a good practice to save the merged dataset as a new file to avoid overwriting your original data.


[Updated on: Fri, 01 March 2024 08:07] by Moderator

Report message to a moderator

Previous Topic: merge IR MR AND PR
Next Topic: Merging children in IR with children in PR
Goto Forum:
  


Current Time: Thu Mar 28 06:16:19 Coordinated Universal Time 2024