The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use in Stata » Merging male and female datasets
Merging male and female datasets [message #3415] Sun, 07 December 2014 19:19 Go to next message
ipike
Messages: 3
Registered: December 2014
Location: Madison, Wisconsin
Member
Hi,

I think this is quite a simple question but I would like to merge the male and female datsets for the most recent Kenyan DHS data. Is there a common variable to use that matches husbands and wives in the dataset?

Thank you very much in advance.
Re: Merging male and female datasets [message #3417 is a reply to message #3415] Sun, 07 December 2014 20:34 Go to previous messageGo to next message
Reduced-For(u)m
Messages: 292
Registered: March 2013
Senior Member


Can you use the Household Member Recode (PR)? That should have some information on both the men and women and you wouldn't need to merge them.

http://dhsprogram.com/data/Dataset-Types.cfm

Also, I believe that HHID is the variable you want (or it's version in the men/women's recode). From the recode manual for DHS VI:

Case identification uniquely identifies each household. In most surveys this is constructed by concatenating the cluster or sample point number and the household number, but in some surveys this may be the questionnaire number taken from the front page of the questionnaire.

http://dhsprogram.com/pubs/pdf/DHSG4/Recode6_DHS_22March2013 _DHSG4.pdf
Re: Merging male and female datasets [message #3419 is a reply to message #3417] Sun, 07 December 2014 21:12 Go to previous messageGo to next message
ipike
Messages: 3
Registered: December 2014
Location: Madison, Wisconsin
Member
Thank you for your quick reply! My confusion is that the household ID variable is not in the female and male datasets and thus I am not sure what the unifying variable is for merging.

I am specifically trying to see if husbands' attitudes have an influence on the number of children their wives have so I think I definitely do need to merge. I'm not sure if that clarifies what I'm trying to do?

Thank you again for your reply!
Re: Merging male and female datasets [message #3420 is a reply to message #3419] Sun, 07 December 2014 23:50 Go to previous messageGo to next message
Reduced-For(u)m
Messages: 292
Registered: March 2013
Senior Member


I think you can concatenate the cluster with the household number to give you a unique HH ID, and that data should be in all recodes. If you have multiple years you could tack the year on as well to avoid repeats across years.

Do you have MV001 and MV002 (or V001 and V002)? If you generate a variable that is both of those put together, you should have a unique ID.

I haven't used these recodes and don't have one handy, but I think some version of 001 and 002 should be in all recodes. You can search for the "right" one or confirm that you are using the right variable by checking it against the recode manual (below):

http://dhsprogram.com/pubs/pdf/DHSG4/Recode6_DHS_22March2013 _DHSG4.pdf
Re: Merging male and female datasets [message #3456 is a reply to message #3420] Fri, 12 December 2014 19:32 Go to previous messageGo to next message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 803
Registered: January 2013
Senior Member
You don't have to go to this effort as we have already produced files that merge the husbands' and wives' data together. See the Couples Recode (CR) file.
Re: Merging male and female datasets [message #3458 is a reply to message #3456] Fri, 12 December 2014 22:13 Go to previous message
ipike
Messages: 3
Registered: December 2014
Location: Madison, Wisconsin
Member
Thank you very much! Very useful.
Previous Topic: Reshaping data using Stata
Next Topic: Understanding variables in PR & IR files
Goto Forum:
  


Current Time: Thu Nov 21 16:13:09 Coordinated Universal Time 2024