Support #2105

How to link parents-children using income variable between BHPS and UKHLS datasets

Added by Peter Wei about 1 month ago. Updated 16 days ago.

Data management
Start date:
% Done:



Dear Sir or Madam,

I am doing a research project on intergenerational income mobility by using BHPS and UKHLS data. For my research project, I need to make a linkage which matches parents who are in the BHPS dataset with their children who are in the UKHLS dataset. For example, I would like to match the incomes of parents who were surveyed in Wave 1 of the BHPS (Wave ba) with the income of their children who were surveyed in Wave 13 of the UKHLS (Wave m).

I have read some of the discussions on the UKHLS Support Forum to my question but cannot find a solution to my problem from them. So far, I have extracted the identifiers of parents (fnpid and mnpid) from the indall dataset for Wave 1 of the BHPS and merged the ba_indall dataset with the ba_indresp dataset to obtain the gross monthly labour income of parents. Following the same procedure, I have also merged the indall and indresp dataset for Wave 13 of the UKHLS to obtain the gross monthly labour income of children.

By using the unique personal identifier “pidp”, when I try to link my newly formed parent dataset (Wave 1 of BHPS) with the children dataset (Wave 13 of the UKHLS),as shown above, on an one-tone basis in STATA in order to form matched parent-children pairs (and/or father-son pairs, mother-son- pairs, father-daughter pairs, mother-daughter pairs), I frequently receive the error message “the variable “pid“/ “pidp” does not uniquely identify the observations in the master dataset”. Although I understand there are two unique personal identifiers of “pid” and “pidp” in the BHPS and UKHLS datasets and I tried both of them for linking, still I could not find a solution for matched parent-children pairs that I needed.

I sincerely thank you so much to provide me advice, guidance and support for my problem.

Have a very nice day.



linking (1.27 KB) linking Understanding Society User Support Team, 05/17/2024 11:53 AM

Updated by Understanding Society User Support Team 27 days ago

  • File linking linking added
  • Category changed from Harmonisation to Data management
  • Status changed from New to Feedback
  • Priority changed from High to Normal
  • % Done changed from 0 to 80

Dear Peter,

Please have a look at the file attached and see if it does what you are looking for. Additionally, I recommend checking Exercises 7 and 8 from our Introduction to Understanding Society course , these should give a good introduction into linking household members.

Best wishes,
Piot Marzec,
UKHLS User Support


Updated by Understanding Society User Support Team 27 days ago

  • Private changed from Yes to No

Updated by Peter Wei 17 days ago

Dear Piot,

Thank you so much for providing me with the do-file which was extremely helpful.

Have a very nice day.



Updated by Understanding Society User Support Team 16 days ago

Dear Peter,

You are welcome. I am happy I could help.

Best wishes,

Also available in: Atom PDF