I use Stata 18 on a windows system.
Dear all,
for my thesis I'd like to merge two datasets, household.dta and kid.dta. They are both in long format and each contain the same time frame of 5 years.
kid.dta contains information about the year, the householdID, the number of kids in the household and 2 dummy variables specifying age groups. This information has to be matched to two (or more) observations in household.dta (e.g. Mum & Dad) by using year and householdID as identifiers. I used merge 1:m hid syear using kid.dta and m:1 hid syear using kid.dta, alternatively. Both yield the result "variables hid year do not uniquely identify observations in the master data" (household.dta being the master).
I already dropped duplicates in the kid.dta set but see myself unable to do the same for the household.dta, since these duplicates make up my households and therefore a big chunk of my analysis.
Would appreciate any help!
Dear all,
for my thesis I'd like to merge two datasets, household.dta and kid.dta. They are both in long format and each contain the same time frame of 5 years.
kid.dta contains information about the year, the householdID, the number of kids in the household and 2 dummy variables specifying age groups. This information has to be matched to two (or more) observations in household.dta (e.g. Mum & Dad) by using year and householdID as identifiers. I used merge 1:m hid syear using kid.dta and m:1 hid syear using kid.dta, alternatively. Both yield the result "variables hid year do not uniquely identify observations in the master data" (household.dta being the master).
I already dropped duplicates in the kid.dta set but see myself unable to do the same for the household.dta, since these duplicates make up my households and therefore a big chunk of my analysis.
Would appreciate any help!
Comment