Re: HH head education level merge [message #3187 is a reply to message #3186] |
Mon, 03 November 2014 03:09   |
kate2
Messages: 15 Registered: May 2014
|
Member |
|
|
Thanks for the link and the suggestions. Using m:1 gives me the error about not uniquely IDing observations in the 'using' data; and using 1:m gives me the error about not uniquely IDing observations in the master data....
So clearly I should be able to uniquely ID observation in the dataset that I want to merge onto my master data set other wise its not useful. I thought that I had then worked out the problem - that I need to use cluster as well as household id to uniquely identify observations in my HH head education dataset - because HH IDs are not sequential through the whole dataset, rather they (I think) restart for each new cluster. Bingo...thought I had it. So I ran these commands below...but then got the same error result...
use "HH member recode"
keep if hv101 = 1
gen HH_ed = hv106
keep v001 v002 HH_ed
sort v001 v002
save "HH_member_recode_HHedonly"
clear
use "child merged dataset"
sort v001 v002
merge m:1 v001 v002 using"HH_member_recode_HHedonly"
>>> variables v001 v002 do not uniquely identify observations in the using data
So I am clearly missing something as to how I uniquely identify households. Unless some households have more than one HH head recorded -- will look into that possibility.
Any other ideas? Thank for your help!
Kate
|
|
|