Support #1912

Merging newborn and child data Waves 11 & 12

Added by Rehana Meeajan 4 months ago. Updated 4 months ago.

Data management
Start date:
% Done:



I am trying to look at breastfeeding data for waves 11 and 12, and note there is breastfeeding data in both k_child and k_newborn datasets. I am struggling to merge the two, and to find wider birth year data for the k_newborn set.

I gather that by using k_hidp and k_pno a unique identifier is created, however, I am not certain of whether the k_pno in k_newborn relates to the mother/parent or the newborn.

When I merge 1:1 in stata using pidp, or hidp, or k_hidp k_pno, it says none of these approaches uniquely identify the data. Will I have a valid data set if i merge m:1 or even m:m? It seems that these data sets (child and newborn) relate to largely different groups. However, I cannot be sure if this is because the newborn data is linked to the parent and not the newborn.

Lastly, if merging m:1 as above (I get 0 matches in stata if I do this), I still have incomplete birth year data for the newborn entries.

Many thanks for any advice.


Updated by Understanding Society User Support Team 4 months ago

  • Category set to Data management
  • Status changed from New to In Progress
  • Private changed from Yes to No

Many thanks for your enquiry. The Understanding Society team is looking into it and we will get back to you as soon as we can. We aim to respond to simple queries within 48 hours and more complex issues within 7 working days.

Best wishes,
Understanding Society User Support Team


Updated by Understanding Society User Support Team 4 months ago

  • Status changed from In Progress to Feedback
  • % Done changed from 0 to 70


w_child - that file is at the child level, there are two unique identifiers, pidp and the combination of w_hidp and w_childpno
w_newborn - that file is multi-level at the parent level, so pidp and pno refers to parents. However, child's pno is also provided: lchno. You can use the combination of w_hidp nad w_lchno to merge this data with other files. You would use merge 1:m when merging newborn to child:

use "$in/ukhls/k_child", replace
merge 1:m k_hidp k_pno using "$outpath/newborn",

and merge m:1 when merging child to newborn

use "$in/ukhls/k_newborn", replace
drop k_pno
rename k_lchno k_pno
merge m:1 k_hidp k_pno using "$in/ukhls/k_child"

However, you may want first to keep one observation per child in the newborn file, in case of your research that should be achieved by keeping only non-missing values on brfed.

Finally, the birth year and sex variables in the newborn file refer only to non-resident children, hence these are missing for most of the newborns. You can link that information from indall or child.

I hope it helps.

Best wishes,
UKHLS User Support

Also available in: Atom PDF