hi everyone,
I am having some issues with my string variables. I have a gender string variable which has three options: "0", "M", "W"
(M = male, W= female, 0 = missing)
I encoded the variable so that I could get rid of the string and create a Dummy using:
encode geschlecht, gen(gender)
Once I do that, however it automatically gives me the labels
(No of Observations)
1 (= "0") 4,349
2 (= "M") 125,466
3 (= "W") 135,793
Once i drop the "0" and change them to missing I have the following
(No of Observations)
2 (= "M") 125,466
3 (= "W") 135,793
and I try to recode gender so that Males have the code 0 and Females the code 1 using
recode gender (2=0) (3=1)
it works but then my issue is that the labels don't budge. So instead I have something like this:
0 125,466
0 135,793
I want to achieve the following:
(No of Observations)
0 (= "M") 125,466
1 (= "W") 135,793
please help!
I am having some issues with my string variables. I have a gender string variable which has three options: "0", "M", "W"
(M = male, W= female, 0 = missing)
I encoded the variable so that I could get rid of the string and create a Dummy using:
encode geschlecht, gen(gender)
Once I do that, however it automatically gives me the labels
(No of Observations)
1 (= "0") 4,349
2 (= "M") 125,466
3 (= "W") 135,793
Once i drop the "0" and change them to missing I have the following
(No of Observations)
2 (= "M") 125,466
3 (= "W") 135,793
and I try to recode gender so that Males have the code 0 and Females the code 1 using
recode gender (2=0) (3=1)
it works but then my issue is that the labels don't budge. So instead I have something like this:
0 125,466
0 135,793
I want to achieve the following:
(No of Observations)
0 (= "M") 125,466
1 (= "W") 135,793
please help!
Comment