Dear all,
I have a panel dataset with a hhid, a dummy reflecting whether the responded is a husband (1) or wife (0). I have generated a new variable, which reflects the education level of the husband and the wife. However, when I tabulate husb_educ if wife_educ != . I get the a message that there are no observations, even though as can be seen by the data example, there are instances where we have observations for both husb_educ and wife_educ in the same household. Moreover, husb_educ and wife_educ were generated using the command: bysort hhid: egen husb_educ = max(educ_level) if husbandwife == 1 (for the husband, and the same procedure for the wife with the dummy = 0). Both education variables take values between 1 and 9. Apologies for any mistakes as I am new to the forum and thank you in advance.
input double hhid float(husbandwife wife_educ husb_educ)
10600 0 . .
10600 . . .
10600 . . .
10600 . . .
10600 0 . .
10600 . . .
10600 . . .
10600 . . .
10600 . . .
10600 . . .
10600 . . .
10600 . . .
10600 . . .
10600 0 . .
10600 . . .
10600 . . .
10600 . . .
10600 . . .
10600 0 . .
10600 . . .
10600 . . .
10600 . . .
10600 0 . .
10600 . . .
10800 . . .
10800 . . .
10800 0 2 .
10800 . . .
10800 0 2 .
10800 0 2 .
10800 . . .
10800 . . .
10800 . . .
10800 . . .
10800 0 2 .
10800 . . .
10800 . . .
10800 . . .
10800 . . .
10800 . . .
10800 0 2 .
10800 . . .
10800 . . .
10800 . . .
10800 . . .
10800 0 2 .
10800 0 2 .
10800 1 . 2
10800 . . .
10800 1 . 2
10800 . . .
10800 . . .
10800 0 2 .
10800 . . .
10800 . . .
10800 0 2 .
10800 0 2 .
10800 . . .
10800 . . .
10800 . . .
10800 . . .
10800 . . .
10800 0 2 .
10800 . . .
10800 . . .
10800 . . .
10800 . . .
10800 1 . 2
10800 1 . 2
10800 . . .
10800 . . .
10800 0 2 .
10800 1 . 2
10800 . . .
10800 . . .
10800 . . .
10800 . . .
10800 . . .
10800 . . .
10800 0 2 .
10800 . . .
10800 . . .
12200 . . .
12200 1 . 2
12200 . . .
12200 . . .
12200 . . .
12200 . . .
12200 . . .
12200 . . .
12200 . . .
12200 . . .
12200 . . .
12200 . . .
12200 . . .
12200 . . .
12200 . . .
12200 . . .
12200 . . .
12200 . . .
I have a panel dataset with a hhid, a dummy reflecting whether the responded is a husband (1) or wife (0). I have generated a new variable, which reflects the education level of the husband and the wife. However, when I tabulate husb_educ if wife_educ != . I get the a message that there are no observations, even though as can be seen by the data example, there are instances where we have observations for both husb_educ and wife_educ in the same household. Moreover, husb_educ and wife_educ were generated using the command: bysort hhid: egen husb_educ = max(educ_level) if husbandwife == 1 (for the husband, and the same procedure for the wife with the dummy = 0). Both education variables take values between 1 and 9. Apologies for any mistakes as I am new to the forum and thank you in advance.
input double hhid float(husbandwife wife_educ husb_educ)
10600 0 . .
10600 . . .
10600 . . .
10600 . . .
10600 0 . .
10600 . . .
10600 . . .
10600 . . .
10600 . . .
10600 . . .
10600 . . .
10600 . . .
10600 . . .
10600 0 . .
10600 . . .
10600 . . .
10600 . . .
10600 . . .
10600 0 . .
10600 . . .
10600 . . .
10600 . . .
10600 0 . .
10600 . . .
10800 . . .
10800 . . .
10800 0 2 .
10800 . . .
10800 0 2 .
10800 0 2 .
10800 . . .
10800 . . .
10800 . . .
10800 . . .
10800 0 2 .
10800 . . .
10800 . . .
10800 . . .
10800 . . .
10800 . . .
10800 0 2 .
10800 . . .
10800 . . .
10800 . . .
10800 . . .
10800 0 2 .
10800 0 2 .
10800 1 . 2
10800 . . .
10800 1 . 2
10800 . . .
10800 . . .
10800 0 2 .
10800 . . .
10800 . . .
10800 0 2 .
10800 0 2 .
10800 . . .
10800 . . .
10800 . . .
10800 . . .
10800 . . .
10800 0 2 .
10800 . . .
10800 . . .
10800 . . .
10800 . . .
10800 1 . 2
10800 1 . 2
10800 . . .
10800 . . .
10800 0 2 .
10800 1 . 2
10800 . . .
10800 . . .
10800 . . .
10800 . . .
10800 . . .
10800 . . .
10800 0 2 .
10800 . . .
10800 . . .
12200 . . .
12200 1 . 2
12200 . . .
12200 . . .
12200 . . .
12200 . . .
12200 . . .
12200 . . .
12200 . . .
12200 . . .
12200 . . .
12200 . . .
12200 . . .
12200 . . .
12200 . . .
12200 . . .
12200 . . .
12200 . . .

Comment