Hello everyone, I would like for some help.
I have data file with four variables: "id", "id_father", "id_mother" and "birth_year". The variable "id" is the ID number of an individiual, and each value in it is unique, therefore the number of people in the sample is as the number of observations. The values in the rest of the variables are not unique since two people in the sample can be siblings.
Furthermore, the parents of an individual can appear as individuals in the sample as well, i.e - values that appear in"id_father" and "id_mother" can appear in "id" as well.
My final goal is to create variables that will be the ID and the year of birth of the child for every person in the sample that his or her children appear in the sample. notice that a parent can have more than one child in the sample.
For now I have no clue how to make such thing happen, and I would be very glad if someone here can help me with a piece of code.
Thank you already,
Fitzgerald.
I have data file with four variables: "id", "id_father", "id_mother" and "birth_year". The variable "id" is the ID number of an individiual, and each value in it is unique, therefore the number of people in the sample is as the number of observations. The values in the rest of the variables are not unique since two people in the sample can be siblings.
Furthermore, the parents of an individual can appear as individuals in the sample as well, i.e - values that appear in"id_father" and "id_mother" can appear in "id" as well.
My final goal is to create variables that will be the ID and the year of birth of the child for every person in the sample that his or her children appear in the sample. notice that a parent can have more than one child in the sample.
For now I have no clue how to make such thing happen, and I would be very glad if someone here can help me with a piece of code.
Thank you already,
Fitzgerald.

Comment