The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Merging data files » Merging in STATA
Merging in STATA [message #619] Fri, 12 July 2013 04:40 Go to next message
Kwamejunge is currently offline  Kwamejunge
Messages: 1
Registered: July 2013
Location: Ghana
Member
Please can you give me the STATA command for merging male file with female (wife). Files and then children of women file, for Ghana 2008 DHS data.
Please what is the STATA command for selecting , deleting variables.
Re: Merging in STATA [message #645 is a reply to message #619] Mon, 22 July 2013 09:51 Go to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3032
Registered: February 2013
Senior Member
Response from: Sarah Bradley, DHS Expert

For merging male and female files: the easiest option is to use the couple's recode (CR file) which already has husbands and wives merged together.

If you then want to make the child the unit of analysis, you could merge the CR file to the BR file, first sorting and then merging on the variable "caseid" which uniquely identifies the mother.

For help merging in Stata, type "help merge" into your command window. This will bring up Stata documentation on using the merge command.
To keep only selected variables, type "keep varlist" where varlist is the variables you want to keep. To delete variables, type "drop varlist".
For more details on the keep or drop commands, type "help keep" or "help drop" into your command window.

Hope that helps!
Sarah
Previous Topic: Merging Wealth Index data with Children's data
Next Topic: Merging Individual and Household data
Goto Forum:
  


Current Time: Thu Apr 18 02:16:46 Coordinated Universal Time 2024