Hello all,
Using household survey panel data I am trying to match the child's characteristics (age, gender,education) with the characteristics of their fathers and mothers. Let me explain the data first.
The 'IDHouse' represents each household within which there are multiple persons identified by 'A001A'. Each individual is given unique id based on 'IDHouse' and 'A001A' as 'ID', and each id has information for T=5 (Juli-November), where 'V1013' represents the time variable (t). Some characteristics of id change over time, for example, if id has a positive result for the COVID19 test in the month t.
Essentially, I will work only with children, this means the values 4,5 and 6 by 'A001A'; and their parents (values 1,2 and 3 by 'A001A').
Then, my Stata code should identify the children and parents within the households and create new variables matching the children with the characteristics of their parents, such as gender, education, income and infection with COVID19 (respectively 'A003', 'A005', 'WoInc' and 'covid19').
Any suggestions?
Many thanks for any assistance received.
Using household survey panel data I am trying to match the child's characteristics (age, gender,education) with the characteristics of their fathers and mothers. Let me explain the data first.
The 'IDHouse' represents each household within which there are multiple persons identified by 'A001A'. Each individual is given unique id based on 'IDHouse' and 'A001A' as 'ID', and each id has information for T=5 (Juli-November), where 'V1013' represents the time variable (t). Some characteristics of id change over time, for example, if id has a positive result for the COVID19 test in the month t.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(ID IDHouse) byte(A001A V1013 A003 A005) float(WoInc covid19) 1 1 1 5 2 5 1600 . 1 1 1 6 2 5 1600 . 1 1 1 7 2 5 1700 . 1 1 1 8 2 5 1700 1 1 1 1 9 2 5 1700 1 1 1 1 10 2 5 1700 1 1 1 1 11 2 5 1700 1 2 1 5 5 2 5 800 . 2 1 5 6 2 5 800 . 2 1 5 7 2 5 1045 . 2 1 5 8 2 5 1045 . 2 1 5 9 2 5 1045 . 2 1 5 10 2 5 1045 . 2 1 5 11 2 5 1045 . 3 1 5 5 2 5 0 . 3 1 5 6 2 5 0 . 3 1 5 7 2 5 0 . 3 1 5 8 2 5 0 1 3 1 5 9 2 5 0 1 3 1 5 10 2 5 0 1 3 1 5 11 2 5 0 1 4 1 10 5 1 2 0 . 4 1 10 6 1 2 0 . 4 1 10 7 1 2 0 . 4 1 10 8 1 2 0 . 4 1 10 9 1 2 0 . 4 1 10 10 1 2 0 . 4 1 10 11 1 2 0 . 5 2 1 5 1 7 3000 . 5 2 1 6 1 7 2000 . 5 2 1 11 1 7 3000 1 6 3 1 5 1 2 0 . 6 3 1 6 1 2 0 . 6 3 1 7 1 2 0 . 6 3 1 8 1 2 0 . 6 3 1 9 1 2 0 . 6 3 1 10 1 2 0 . 6 3 1 11 1 2 0 . 7 3 2 5 2 5 1000 . 7 3 2 6 2 5 1000 . 7 3 2 7 2 5 1000 1 7 3 2 8 2 5 1000 1 7 3 2 9 2 5 1000 1 7 3 2 10 2 5 1045 1 7 3 2 11 2 5 1400 1 8 3 4 5 2 7 0 . 8 3 4 6 2 7 0 . 8 3 4 7 2 7 0 . 8 3 4 8 2 7 0 . 8 3 4 9 2 7 0 . end
Essentially, I will work only with children, this means the values 4,5 and 6 by 'A001A'; and their parents (values 1,2 and 3 by 'A001A').
Then, my Stata code should identify the children and parents within the households and create new variables matching the children with the characteristics of their parents, such as gender, education, income and infection with COVID19 (respectively 'A003', 'A005', 'WoInc' and 'covid19').
Any suggestions?
Many thanks for any assistance received.
Comment