Support #937
open
Merge children to parents
Added by Karl Overdick almost 7 years ago.
Updated over 1 year ago.
Description
I would like to add children data from child in the parent rows. However, I haven't found a suitable identifier for the children in the parent data that I could use to easily match the children. There are also some other difficulties in this. For example, when parents have several children I would have to somehow put several children into the one row of their parent.
1) What is the best identifier to use?
2) Ideas for the problems coming up?
Thanks in advance!
- Category set to Data analysis
- Status changed from New to In Progress
- Assignee set to Stephanie Auty
- Target version set to X M
- % Done changed from 0 to 10
- 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.
Best wishes,
Stephanie Auty - Understanding Society User Support Officer
- Status changed from In Progress to Feedback
- Assignee changed from Stephanie Auty to Karl Overdick
- % Done changed from 10 to 70
Dear Karl,
You will need to merge this data using the parent identifiers in the child's record. If you are only interested in natural parents you can use w_mnpid (for the mother) and w_fnpid (for the father). w_mnspid and w_fnspid also include step and adoptive parents’ pidp. You will find these variables in w_child (under 10 years old), w_youth (age 10-15) and w_indresp (for over 16s who live with their parents), and also w_indall (for all persons in household, including children and non-respondents). These variables are based on data collected in the household grid and so are the pidp(s) of the parent(s) they are currently living with. If you want to find out about a natural parent they lived with in a previous wave you will need to look at the data file for that wave.
Section 3.11 of the User Guide had some example code for matching individuals within a household based on spouses/partners which you could modify if you want to have one row per child rather than per parent. However, you will need to use a 1:m or m:1 (depending on which file you have open) merge since there will be more than one child to each parent. You can download the User Guide here: https://www.understandingsociety.ac.uk/sites/default/files/downloads/documentation/mainstage/user-guides/mainstage-waves-1-7-user-guide.pdf
If you want one row per parent, and information for each of their children in that row, then you would need multiple sets of the variables you wish to use, e.g. first child's year of birth, second child's year of birth. You could also create summary variables, e.g. eldest and youngest child's information.
Best wishes,
Stephanie Auty - Understanding Society User Support Officer
Hi Stephanie,
Thanks a lot that is very useful. We converted children into wide format and then matched them with the mnspid and fnspid now.
Best,
Karl
- Status changed from Feedback to Resolved
- % Done changed from 70 to 100
- Category changed from Data analysis to Data management
Also available in: Atom
PDF