BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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?
2 REPLIES 2
andreas_lds
Jade | Level 19
Q1: No, the order depends on the class-variables natural order.
Q2: Yes.
Q3: Yes.
Q4: Yes.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Consider this SAS documentation reference on MEANS/SUMMARY:

http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/a000146737.htm#a000438726

Also, I'm convinced you could answer some of these questions by observing the SAS system execution - consider using the SASHELP.CLASS file if none is available.

Scott Barry
SBBWorks,Inc.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 913 views
  • 0 likes
  • 3 in conversation