Hi,
Stata version 13.1 on Windows 7
I have an hierarchical dataset (Person in zip-code areas(plz)). My variable of interest (foc) is ordinal with 4 categories (0-3). Also I have a variable called osten which is a dummy and divides my respondents into people from West and East of the country.
My goal: (see photo)
What I would like to end up with, is one graph with to box-plots for osten=0 and osten=1 which shows the percentage of people in the categories 2 and 3 of foc on the zip-code level.
Normally I would use the -collapse- command: collapse foc osten, by(plz)
I know that I have different options with the collapse command (mean, max, min, p1 p50 etc) but I am not able (like in SPSS with the pgt (percentage great than x)-option in the AGGREGATE-command) to save a new variable on the zip-code level which represents the percentages of the two highest categories of my dependent variable.
Any suggestions?
Stata version 13.1 on Windows 7
I have an hierarchical dataset (Person in zip-code areas(plz)). My variable of interest (foc) is ordinal with 4 categories (0-3). Also I have a variable called osten which is a dummy and divides my respondents into people from West and East of the country.
My goal: (see photo)
What I would like to end up with, is one graph with to box-plots for osten=0 and osten=1 which shows the percentage of people in the categories 2 and 3 of foc on the zip-code level.
Normally I would use the -collapse- command: collapse foc osten, by(plz)
I know that I have different options with the collapse command (mean, max, min, p1 p50 etc) but I am not able (like in SPSS with the pgt (percentage great than x)-option in the AGGREGATE-command) to save a new variable on the zip-code level which represents the percentages of the two highest categories of my dependent variable.
Any suggestions?
Comment