Hello all,
I have merged a longitudinal panel data set, so now I have informations for each individual and their household data. I want to identify the spouse for each individual if they have one and also their children, after which I want to find out their year and month of birth, so that I can find newly born children for each wave, to classify as a new dummy variable for BIRTHOFCHILD.
For context I am using RLMS data.
The relationship variable between each individual is constructed in a 'matrix' where the text in red is the variable for each relationship in the matrix. I also attach the family roster, and that is what I am trying to use to identify children. The survey is conducted between September of a given year up until January of the next, so I guess I could calculate their age relative to the date of the survey to see if they were born in between the previous and current survey wave. Any feedback, help or comments would be much appreciated. Thank you

I have merged a longitudinal panel data set, so now I have informations for each individual and their household data. I want to identify the spouse for each individual if they have one and also their children, after which I want to find out their year and month of birth, so that I can find newly born children for each wave, to classify as a new dummy variable for BIRTHOFCHILD.
For context I am using RLMS data.
The relationship variable between each individual is constructed in a 'matrix' where the text in red is the variable for each relationship in the matrix. I also attach the family roster, and that is what I am trying to use to identify children. The survey is conducted between September of a given year up until January of the next, so I guess I could calculate their age relative to the date of the survey to see if they were born in between the previous and current survey wave. Any feedback, help or comments would be much appreciated. Thank you
Code:
* Example generated by -dataex-. For more info, type help dataex clear input double(id_w idind id_i id_h h5 nfm b1_1 idind1 b1_2_1 b1_2_2 b1_1_23 b1_2_23 b1_3 b1_4 b1_5 b1_8) 5 1 100101 1001 2 2 1 1 . . . . 11 2 1973 2 5 2 100102 1001 1 2 1 1 . . . . 11 2 1973 2 5 3 100201 1002 2 4 1 3 . . . . 12 2 1955 3 5 4 100202 1002 1 4 1 3 . . . . 12 2 1955 3 5 5 100203 1002 2 4 1 3 . . . . 12 2 1955 3 5 6 100204 1002 1 4 1 3 . . . . 12 2 1955 3 5 7 100301 1003 2 1 1 7 . . . . 12 2 1944 3 5 8 100401 1004 2 1 1 8 . . . . 12 2 1968 1 5 9 100501 1005 2 2 1 9 . . . . 12 2 1946 2 5 10 100502 1005 1 2 1 9 . . . . 12 2 1946 2 5 11 100601 1006 2 3 1 11 . . . . 12 2 1970 2 5 12 100602 1006 1 3 1 11 . . . . 12 2 1970 2 5 13 100603 1006 2 3 1 11 . . . . 12 2 1970 2 5 14 100701 1007 1 2 1 14 . . . . 9 1 1944 3 5 15 100702 1007 2 2 1 14 . . . . 9 1 1944 3 5 16 100801 1008 2 2 1 16 . . . . 12 2 1938 2 5 17 100802 1008 1 2 1 16 . . . . 12 2 1938 2 5 18 100901 1009 2 4 1 18 . . . . 12 2 1954 2 5 19 100902 1009 1 4 1 18 . . . . 12 2 1954 2 5 20 100903 1009 1 4 1 18 . . . . 12 2 1954 2 5 21 100904 1009 2 4 1 18 . . . . 12 2 1954 2 5 22 101201 1012 2 4 1 22 . . . . 12 2 1961 2 5 23 101202 1012 1 4 1 22 . . . . 12 2 1961 2 5 24 101203 1012 2 4 1 22 . . . . 12 2 1961 2 5 25 101204 1012 1 4 1 22 . . . . 12 2 1961 2 5 26 101301 1013 2 2 1 26 . . . . 12 2 1931 4 5 27 101302 1013 1 2 1 26 . . . . 12 2 1931 4 5 28 101401 1014 1 3 1 28 . . . . 12 1 1968 2 5 29 101402 1014 2 3 1 28 . . . . 12 1 1968 2 5 30 101403 1014 1 3 1 28 . . . . 12 1 1968 2 5 31 101501 1015 2 1 1 31 . . . . 12 2 1920 4 5 32 101601 1016 1 4 1 32 . . . . 12 1 1958 3 5 33 101602 1016 2 4 1 32 . . . . 12 1 1958 3 5 34 101603 1016 1 4 1 32 . . . . 12 1 1958 3 5 35 101604 1016 1 4 1 32 . . . . 12 1 1958 3 5 36 101701 1017 2 4 1 36 . . . . 12 2 1954 2 5 37 101702 1017 1 4 1 36 . . . . 12 2 1954 2 5 38 101703 1017 1 4 1 36 . . . . 12 2 1954 2 5 39 101704 1017 2 4 1 36 . . . . 12 2 1954 2 5 40 101801 1018 2 3 1 40 . . . . 12 2 1973 2 5 41 101802 1018 1 3 1 40 . . . . 12 2 1973 2 5 42 101803 1018 1 3 1 40 . . . . 12 2 1973 2 5 43 101901 1019 2 3 1 43 . . . . 12 2 1953 2 5 44 101903 1019 1 3 1 43 . . . . 12 2 1953 2 5 45 102001 1020 2 4 1 45 . . . . 12 2 1962 2 5 46 102002 1020 1 4 1 45 . . . . 12 2 1962 2 5 47 102003 1020 2 4 1 45 . . . . 12 2 1962 2 5 48 102004 1020 1 4 1 45 . . . . 12 2 1962 2 5 49 102101 1021 1 1 1 49 . . . . 12 1 1927 4 5 50 102201 1022 1 2 1 50 . . . . 4 1 1972 2 5 51 102202 1022 2 2 1 50 . . . . 4 1 1972 2 5 52 102401 1024 2 2 1 52 . . . . 12 2 1948 2 5 53 102402 1024 1 2 1 52 . . . . 12 2 1948 2 5 54 102501 1025 2 1 1 54 . . . . 12 2 1924 4 5 55 102601 1026 2 2 1 55 . . . . 12 2 1946 2 5 56 102602 1026 1 2 1 55 . . . . 12 2 1946 2 5 57 102801 1028 2 2 1 57 . . . . 12 2 1953 2 5 58 102802 1028 1 2 1 57 . . . . 12 2 1953 2 5 59 103001 1030 1 5 1 59 . . . . 12 1 1964 2 5 60 103002 1030 2 5 1 59 . . . . 12 1 1964 2 5 61 103003 1030 2 5 1 59 . . . . 12 1 1964 2 5 62 103004 1030 1 5 1 59 . . . . 12 1 1964 2 5 63 103005 1030 2 5 1 59 . . . . 12 1 1964 2 5 64 200101 2001 2 5 1 64 . . . . 12 2 1965 2 5 65 200102 2001 1 5 1 64 . . . . 12 2 1965 2 5 66 200103 2001 1 5 1 64 . . . . 12 2 1965 2 5 67 200104 2001 1 5 1 64 . . . . 12 2 1965 2 5 68 200105 2001 1 5 1 64 . . . . 12 2 1965 2 5 69 200201 2002 2 2 1 69 . . . . 12 2 1938 2 5 70 200202 2002 1 2 1 69 . . . . 12 2 1938 2 5 71 200301 2003 2 1 1 71 . . . . 12 2 1914 1 5 72 200401 2004 2 3 1 72 . . . . 12 2 1939 2 5 73 200402 2004 1 3 1 72 . . . . 12 2 1939 2 5 74 200403 2004 2 3 1 72 . . . . 12 2 1939 2 5 75 200601 2006 2 5 1 75 . . . . 12 2 1961 2 5 76 200602 2006 1 5 1 75 . . . . 12 2 1961 2 5 77 200603 2006 2 5 1 75 . . . . 12 2 1961 2 5 78 200604 2006 2 5 1 75 . . . . 12 2 1961 2 5 79 200605 2006 1 5 1 75 . . . . 12 2 1961 2 5 80 200701 2007 2 2 1 80 . . . . 12 2 1931 1 5 81 200801 2008 1 2 1 81 . . . . 12 1 1925 2 5 82 200802 2008 2 2 1 81 . . . . 12 1 1925 2 5 83 200901 2009 1 2 1 83 . . . . 12 1 1933 2 5 84 200902 2009 2 2 1 83 . . . . 12 1 1933 2 5 85 201001 2010 2 4 1 85 . . . . 12 2 1959 2 5 86 201002 2010 1 4 1 85 . . . . 12 2 1959 2 5 87 201003 2010 2 4 1 85 . . . . 12 2 1959 2 5 88 201004 2010 1 4 1 85 . . . . 12 2 1959 2 5 89 300101 3001 2 3 1 89 . . . . 12 2 1942 2 5 90 300102 3001 1 3 1 89 . . . . 12 2 1942 2 5 91 300103 3001 2 3 1 89 . . . . 12 2 1942 2 5 92 300201 3002 2 7 1 92 . . . . 12 2 1958 2 5 93 300202 3002 1 7 1 92 . . . . 12 2 1958 2 5 94 300203 3002 1 7 1 92 . . . . 12 2 1958 2 5 95 300204 3002 2 7 1 92 . . . . 12 2 1958 2 5 96 300205 3002 1 7 1 92 . . . . 12 2 1958 2 5 97 300206 3002 2 7 1 92 . . . . 12 2 1958 2 5 98 300207 3002 1 7 1 92 . . . . 12 2 1958 2 5 99 300301 3003 2 3 1 99 . . . . 12 2 1953 4 5 100 300302 3003 1 3 1 99 . . . . 12 2 1953 4 end label values id_w id_w label def id_w 5 " 1994", modify label values h5 h5 label def h5 1 "MALE", modify label def h5 2 "FEMALE", modify label values b1_1 b1_1 label def b1_1 1 "HAS AN INDIVIDUAL QUESTIONNAIRE", modify label values b1_2_1 b1_2_1 label values b1_2_2 b1_2_2 label values b1_1_23 b1_1_23 label values b1_2_23 b1_2_23 label values b1_3 b1_3 label values b1_4 b1_4 label def b1_4 1 "Male", modify label def b1_4 2 "Female", modify label values b1_5 b1_5 label values b1_8 b1_8 label def b1_8 1 "Has never been married", modify label def b1_8 2 "Married", modify label def b1_8 3 "Divorced and not married", modify label def b1_8 4 "Widower (widow)", modify