Hello all.
In my wide format dataset I have two variables for the country of the respondent, let's say country_surveyA and country_surveyB. Both variables are coded in the same way: 1 is born in Country, 0 is born outside of Country, -1 is "not applicable". When I tab these two variables I find that 99.9% of the observations that are "not applicable" for country_surveyA have values 0 or 1 for country_surveyB - and viceversa. As far as my understanding goes, this is due to the fact that for a part of the sample the answer to the question "Where were you born?" came from a different survey, and a "consolidated" variable was not created for the main release dataset.
My intention is to create only one variable, Country, so that all the observations are coded either 1 or 0, having removed all the "not applicable" observations (for what I'm doing I don't care whether the answer came from one survey or the other, being this a time-invariant variable). The ID variable was the same in both surveys.
How can I achieve this?
Thank you for your help.
In my wide format dataset I have two variables for the country of the respondent, let's say country_surveyA and country_surveyB. Both variables are coded in the same way: 1 is born in Country, 0 is born outside of Country, -1 is "not applicable". When I tab these two variables I find that 99.9% of the observations that are "not applicable" for country_surveyA have values 0 or 1 for country_surveyB - and viceversa. As far as my understanding goes, this is due to the fact that for a part of the sample the answer to the question "Where were you born?" came from a different survey, and a "consolidated" variable was not created for the main release dataset.
My intention is to create only one variable, Country, so that all the observations are coded either 1 or 0, having removed all the "not applicable" observations (for what I'm doing I don't care whether the answer came from one survey or the other, being this a time-invariant variable). The ID variable was the same in both surveys.
How can I achieve this?
Thank you for your help.
Comment