A data set, POPULATION, with 2 variables: COUNTRY(=any of 50 countries) and GENDER={F, M}.
My code:
proc summary data=population nway order=freq;
class country gender;
output out=outpop(drop=_type_);
run;
Is it the total number of people (F+M) that gives the order in data set OUTPOP?
E.g. If there were only 3 countries X, Y, Z: Country X with 1 M and 100 000 F, country Y with 90 000 M and 10 000 F, country Z with 50 000 M and 50 000 F, then will the order be:
Country Gender _FREQ_
X F 100000
X M 1
Y F 10000
Y M 90000
Z F 50000
Z M 50000
Q1: Is it the total number of persons in each country that decides the ordering?
Q2: Will each countrys two records always be kept together regardless of the numbers of different genders?
Q3: Y and Z have both total 100000. Is country Y positioned before country Z because Y comes before Z in the alphabet?
Q4: And are females always positioned before men because F comes before M in the alphabet, regardless of the number of individual persons?