Hi all,
I have a question regarding a long panel set I am using.
I have variables for household (IDHH), individual ID (HHPBASE), the survey (whether it was round 1 or round 2), PBASE (the id number of the individual within the household), RO8 (father's ID), RO9 (mother's ID), and ED6 (years of education) as below - there are a lot more variables in this and I will want to map other variables, not just years of education, but for illustration purposes I have provided the following from the data set:
What I am attempting to do here is to, for each observation, add the education levels of the mother and father. Ultimately, I will want to run a regression where the outcome variable is child's education, and I want to control for parent's education. Of course, I understand that this will reduce the number of observations, but that is fine as I am interested in the younger generations cohabiting with their parents, in which case the data should be present for all individuals.
What would be the best way to do this?
Thanks in advance!
Sanchit
I have a question regarding a long panel set I am using.
I have variables for household (IDHH), individual ID (HHPBASE), the survey (whether it was round 1 or round 2), PBASE (the id number of the individual within the household), RO8 (father's ID), RO9 (mother's ID), and ED6 (years of education) as below - there are a lot more variables in this and I will want to map other variables, not just years of education, but for illustration purposes I have provided the following from the data set:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str10 IDHH double HHPBASE int(SURVEY PBASE RO8 RO9 ED6) "010201010" 101020101001 1 1 2 . 0 "010201010" 101020101002 1 2 1 . 0 "010201010" 101020101003 1 3 . 1 8 "010201010" 101020101005 1 5 . 1 7 "010201010" 101020101006 1 6 . 1 2 "010201020" 101020102001 1 1 2 . 10 "0102010201" 101020102001 2 1 75 75 12 "010201020" 101020102003 1 3 4 1 15 "0102010201" 101020102003 2 3 3 1 15 "010201020" 101020102004 1 4 3 . 0 "0102010201" 101020102004 2 4 2 . 8 "010201020" 101020102005 1 5 . 3 7 "0102010201" 101020102005 2 5 . 2 12 "010201020" 101020102006 1 6 . 3 3 "0102010201" 101020102006 2 6 . 2 8 "010201020" 101020102007 1 7 . 3 0 "0102010201" 101020102007 2 7 . 2 5 "010201020" 101020102008 1 8 9 1 15 "0102010201" 101020102008 2 8 8 1 15 "010201020" 101020102009 1 9 8 . 12 "0102010201" 101020102009 2 9 7 . 12 "010201020" 101020102010 1 10 . 8 2 "0102010201" 101020102010 2 10 . 7 6 "010201020" 101020102011 1 11 . 8 0 "0102010201" 101020102011 2 11 . 7 2 "010201020" 101020102012 1 12 13 1 15 "0102010201" 101020102012 2 12 13 1 15 "010201020" 101020102013 1 13 12 . 12 "0102010201" 101020102013 2 13 12 . 7 "010201020" 101020102014 1 14 . 12 0 "0102010201" 101020102014 2 14 . 12 0 "010201020" 101020102015 1 15 . . 0 "0102010201" 101020102015 2 15 . . 0 "010201030" 101020103001 1 1 2 . 9 "0102010301" 101020103001 2 1 2 69 10 "010201030" 101020103002 1 2 1 . 0 "0102010301" 101020103002 2 2 1 . 0 "010201030" 101020103003 1 3 . 1 9 "0102010301" 101020103003 2 3 . 1 11 "010201030" 101020103004 1 4 . 1 6 "0102010301" 101020103004 2 4 . 1 12 "010201030" 101020103005 1 5 . 1 5 "0102010301" 101020103005 2 5 . 1 9 "010201030" 101020103006 1 6 . 1 1 "0102010301" 101020103006 2 6 . 1 6 "010201030" 101020103007 1 7 . 1 0 "0102010301" 101020103007 2 7 . 1 4 "010201040" 101020104001 1 1 2 . 0 "0102010401" 101020104001 2 1 2 75 0 "010201040" 101020104002 1 2 1 . 0 "0102010401" 101020104002 2 2 1 . 0 "010201040" 101020104003 1 3 . 1 6 "0102010401" 101020104003 2 3 . 1 5 "010201040" 101020104004 1 4 . 1 1 "0102010401" 101020104004 2 4 . 1 7 "010201040" 101020104005 1 5 . 1 0 "0102010401" 101020104005 2 5 . 1 6 "010201050" 101020105002 1 2 3 1 0 "0102010501" 101020105002 2 2 2 75 8 "010201050" 101020105003 1 3 2 . 0 "0102010501" 101020105003 2 3 1 . 0 "010201050" 101020105006 1 6 . 2 0 "0102010501" 101020105006 2 6 4 1 0 "010201050" 101020105007 1 7 . 2 8 "0102010501" 101020105007 2 7 7 1 9 "010201050" 101020105008 1 8 . 2 5 "0102010501" 101020105008 2 8 . 1 12 "010201050" 101020105009 1 9 . 2 4 "0102010501" 101020105009 2 9 . 1 9 "010201050" 101020105010 1 10 . 2 0 "0102010501" 101020105010 2 10 . 1 4 "010201060" 101020106001 1 1 75 . 0 "0102010601" 101020106001 2 1 75 75 0 "010201060" 101020106012 1 12 . 1 0 "0102010601" 101020106012 2 12 3 1 0 "010201060" 101020106013 1 13 14 1 0 "0102010601" 101020106013 2 13 7 1 0 "010201060" 101020106014 1 14 13 . 0 "0102010601" 101020106014 2 14 6 . 0 "010201060" 101020106015 1 15 . 1 0 "0102010601" 101020106015 2 15 11 1 0 "010201070" 101020107001 1 1 2 . 0 "0102010701" 101020107001 2 1 2 75 0 "010201070" 101020107002 1 2 1 . 0 "0102010701" 101020107002 2 2 1 . 0 "010201070" 101020107003 1 3 . 1 0 "0102010701" 101020107003 2 3 . 1 0 "010201070" 101020107004 1 4 . 1 7 "0102010701" 101020107004 2 4 . 1 8 "010201070" 101020107006 1 6 . 1 0 "0102010701" 101020107006 2 6 . 1 0 "010201070" 101020107007 1 7 . 1 0 "0102010701" 101020107007 2 7 . 1 0 "010201070" 101020107008 1 8 . 1 1 "0102010701" 101020107008 2 8 . 1 9 "010201070" 101020107009 1 9 . 1 1 "0102010701" 101020107009 2 9 . 1 9 "010201080" 101020108001 1 1 2 . 0 "0102010801" 101020108001 2 1 2 . 0 "010201080" 101020108002 1 2 1 . 0 end label values SURVEY SURVEY label def SURVEY 1 "IHDS1 1", modify label def SURVEY 2 "IHDS2 2", modify label values RO8 RO8 label def RO8 75 "Died 75", modify label values RO9 RO9 label def RO9 69 "Other nonres 69", modify label def RO9 75 "Died 75", modify label values ED6 ED6 label def ED6 0 "none, <1 0", modify label def ED6 1 "1st class 1", modify label def ED6 2 "2nd class 2", modify label def ED6 3 "3rd class 3", modify label def ED6 4 "4th class 4", modify label def ED6 5 "5th class 5", modify label def ED6 6 "6th class 6", modify label def ED6 7 "7th class 7", modify label def ED6 8 "8th class 8", modify label def ED6 9 "9th class 9", modify label def ED6 10 "Secondary 10", modify label def ED6 11 "11th Class 11", modify label def ED6 12 "High Secondary 12", modify label def ED6 15 "Bachelors 15", modify
What would be the best way to do this?
Thanks in advance!
Sanchit

Comment