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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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