The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Merging data files » HH head education level merge
HH head education level merge [message #3184] Sun, 02 November 2014 17:45 Go to previous message
kate2
Messages: 15
Registered: May 2014
Member
Dear all,

I am working on the Tanzania 2011/12 MIS dataset. I am working in Stata 13.

I currently have a dataset that I have created by merging the observations for all children under five in the household member recode, onto the child recode. This gives me all the malaria test results in the same place as the information on treatment seeking, prevention etc for children under five.
I would also like to add a variable for the head of households educational attainment to this dataset. This information is available in the HH member recode but not the child recode (as far as I can see).

I attempted the following:

use "HH member recode"
keep if hv101 = 1
gen HH_ed = hv106
keep v002 HH_ed
save "HH_member_recode_HHedonly"
clear
use "child merged dataset"
sort v002
merge 1:m v002 using"HH_member_recode_HHedonly"

This gives me the error message:

variable v002 does not uniquely identify observations in the using data

I am not expecting v002 to uniquely identify observations. I know there will often be several children in each household so I want the HH head ed level variable to be merged and replicated for each child with the same HH number as this HH head. So I assume I do want 1:m; but perhaps not? Could you point me in the right direction here. I am clearly doing something wrong.

Thanks a lot
Kate



 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Can continuous DHS be merged with standard DHS?
Next Topic: how to merge data files from different countries
Goto Forum:
  


Current Time: Fri Mar 29 09:44:04 Coordinated Universal Time 2024