I have a dataset where individual subjects are uniquely identified by SUBJECTID. Each subject belongs to a household which is identified by the variable HOUSEID. There can be 1 or 2 subjects in each household. We asked a subset of questions ONLY of one member of the household. For subjects in the household who were not asked this series of questions, they currently have missing values for those particular variables in the dataset. I would like to input the other household member’s response in for these missing responses, and I would like this information to be created as a new variable (because I would like to keep the original variables intact). I would also like the original value for the respondent to be carried over into the new variable as well.
Briefly, here's what the data look like:
data temp;
input houseid subjectid hhincome hhtype;
datalines;
1001 10011 10000 2
1001 10012
1002 10021
1002 10022 25000 3
;
... View more