The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Merging data files » Mergining PR onto a Combined IR, MR Dataset in SPSS
Re: Mergining PR onto a Combined IR, MR Dataset in SPSS [message #4111 is a reply to message #3731] Wed, 01 April 2015 18:15 Go to previous messageGo to previous message
Gazimbi is currently offline  Gazimbi
Messages: 7
Registered: March 2015
Location: United Kingdom
Member
Hi, Trevor

Thank you for your custom. I hope this time I found my saviour. There is quite a significant amount of discussion on merging datasets in this forum but I don't seem to get it. Here is my problem, I want to merge Zimbabwe DHS datasets (women, men and HIV). I know I should sort and match files, however, I don't know how to drop m prefix on the male variables. I am just wondering whether the renaming procedure you provided below in another discussion could be applicable to my situation in Zimbabwe


* Working directory.
cd 'C:\Data\DHS_SPSS'.
* Open the men's data.
get file='BDMR61FL.SAV'.
* rename men's variables to the same name as women's variables.
rename variables (MCASEID MV000 to MV016 MV021 to MV032=CASEID V000 to V016 V021 to V032).
rename variables (MV801 MV802 MV803 = V801 V802 V803).
rename variables (MV101 to MV107 = V101 to V107).
rename variables (MV130 MV131 MV133 to MV136 MV138 = V130 V131 V133 to V136 V138).
rename variables (MV149 to MV152 MV155 to MV159 MV167 MV168 MV190 MV191 = V149 to V152 V155 to V159 V167 V168 V190 V191).
rename variables (MV201 to MV207 MV212 MV213 MV217 MV218 MV225 MV245 to MV252 = V201 to V207 V212 V213 V217 V218 V225 V245 to V252).
* ...
rename variables (MV714 MV716 MV717 MV719 MV721 MV731 MV732 = V714 V716 V717 V719 V721 V731 V732).
* ...

* Sort men's data according to ID fields.
sort cases by V001 V002 V003.
* Save the required subset of data - adapt to your needs.
save outfile='MRsmall.sav' /keep=caseid V001 to V032 V101 to V107 V714 V716 V717 V719 V721 V731 V732.


Your help will be greatly appreciated






MG
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: merging household and husbands' info to women
Next Topic: MERGING THREE DHS DATASETS
Goto Forum:
  


Current Time: Sun May 12 05:49:52 Coordinated Universal Time 2024