Hi,
The sex variable in the survey that I am cleaning was structured as dichotomous variables and the respondents can choose more than 1 sex variable (they can choose being both male and female). When I try to combine them into a single variable, some of the responses go missing. How can I prevent that from happening?
Q2_1 What is your gender - male (1=yes, 0=no) 199 answered yes
Q2_2 What is your gender - female (1=yes, 0=no) 306 answered yes
Q2_2 What is your gender - LGBTQ(1=yes, 0=no) 15 answered yes
Q2_2 What is your gender - Others (open text) 1 answered and wrote their own gender
This is my code
This is what I am producing
194 male
304 female
15 LGTBQ
No answer for open text
I am missing 8 people
Could anyone point me to the right direction?
The sex variable in the survey that I am cleaning was structured as dichotomous variables and the respondents can choose more than 1 sex variable (they can choose being both male and female). When I try to combine them into a single variable, some of the responses go missing. How can I prevent that from happening?
Q2_1 What is your gender - male (1=yes, 0=no) 199 answered yes
Q2_2 What is your gender - female (1=yes, 0=no) 306 answered yes
Q2_2 What is your gender - LGBTQ(1=yes, 0=no) 15 answered yes
Q2_2 What is your gender - Others (open text) 1 answered and wrote their own gender
This is my code
Code:
gen gender=. replace gender=1 if Q2_1==1 replace gender=2 if Q2_2==1 replace gender=3 if Q2_3==1 replace gender=4 if Q2_4>.
This is what I am producing
194 male
304 female
15 LGTBQ
No answer for open text
I am missing 8 people
Could anyone point me to the right direction?
Comment