Hello - I have a categorical variable with 99 categories ('city'). The city variable shows me how many people are in each of the 99 cities.
I have a female variable for each person in the data set (0/1). I can use the tab code to see how many men and women are in each individual city (category).
Is there a way to create a new variable 'city_percentfemale' that will list the %female (female in that city N/total N in that city) for each individual city (category) within the city variable?
Thank you!
Julie
I have a female variable for each person in the data set (0/1). I can use the tab code to see how many men and women are in each individual city (category).
Is there a way to create a new variable 'city_percentfemale' that will list the %female (female in that city N/total N in that city) for each individual city (category) within the city variable?
Thank you!
Julie
Comment