Dear all,
I have a variable (household No.) that assigns an id number to each household. Within each household I have 2 people interviewed. The data is in long format. Hence, each Household No. is repeated twice.
Household No. Respondent Number
1 1
1 2
2 1
2 2
3 1
3 2
4 1
4 2
I would like to see how the households are distributed across geographical areas and other aspects. In order to do this, I need each household to be listed only once.
How can I create a variable with includes the household ID only once and not twice?
Or do you have other suggestions on how to go about it?
Trying to change the data to wide format gives me the following error:
values of variable RespondentNO not unique within HouseholdNo
Your data are currently long. You are performing a reshape
wide. You specified i(HouseholdNo) and j(RespondentNO).
There are observations within i(HouseholdNo) with the same
value of j(RespondentNO). In the long data, variables i()
and j() together must uniquely identify the observations.
Thank you for your help.
I have a variable (household No.) that assigns an id number to each household. Within each household I have 2 people interviewed. The data is in long format. Hence, each Household No. is repeated twice.
Household No. Respondent Number
1 1
1 2
2 1
2 2
3 1
3 2
4 1
4 2
I would like to see how the households are distributed across geographical areas and other aspects. In order to do this, I need each household to be listed only once.
How can I create a variable with includes the household ID only once and not twice?
Or do you have other suggestions on how to go about it?
Trying to change the data to wide format gives me the following error:
values of variable RespondentNO not unique within HouseholdNo
Your data are currently long. You are performing a reshape
wide. You specified i(HouseholdNo) and j(RespondentNO).
There are observations within i(HouseholdNo) with the same
value of j(RespondentNO). In the long data, variables i()
and j() together must uniquely identify the observations.
Thank you for your help.
Comment