Merging in STATA [message #619] |
Fri, 12 July 2013 04:40  |
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  |
Bridgette-DHS
Messages: 3230 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
|
|
|