Solved
Contributor
Posts: 50

# Help with Weight example from SAS Website

I'm going through an example from the website and am not sure where one set of #'s are coming from... Please see the link and the highlighted section from the link below:

SAS/STAT(R) 9.22 User's Guide

Here is the section from which I can't determine where the #'s are coming from:

data IceCream;

set IceCream;

Weight=1/Prob;

run;

Any help is greatly appreciated!

Accepted Solutions
Solution
‎01-15-2014 11:09 AM
Super User
Posts: 23,778

## Re: Help with Weight example from SAS Website

The Ice Cream dataset only has 40 observations.  The 20 is the number of students in Grade 7, 9 in Grade 8, 11 in Grade 9.

The 1824 are the population not the sample size.

See the previous example for the dataset.

data IceCream;

if (Spending < 10) then Group='less';

else Group='more';

datalines;

7 7  7  7  8 12  9 10  7  1  7 10  7  3  8 20  8 19  7 2

7 2  9 15  8 16  7  6  7  6  7  6  9 15  8 17  8 14  9 8

9 8  9  7  7  3  7 12  7  4  9 14  8 18  9  9  7  2  7 1

7 4  7 11  9  8  8 10  8 13  7  2  9  6  9 11  7  2  7 9

;

proc freq data=icecream;

run;

All Replies
Solution
‎01-15-2014 11:09 AM
Super User
Posts: 23,778

## Re: Help with Weight example from SAS Website

The Ice Cream dataset only has 40 observations.  The 20 is the number of students in Grade 7, 9 in Grade 8, 11 in Grade 9.

The 1824 are the population not the sample size.

See the previous example for the dataset.

data IceCream;

if (Spending < 10) then Group='less';

else Group='more';

datalines;

7 7  7  7  8 12  9 10  7  1  7 10  7  3  8 20  8 19  7 2

7 2  9 15  8 16  7  6  7  6  7  6  9 15  8 17  8 14  9 8

9 8  9  7  7  3  7 12  7  4  9 14  8 18  9  9  7  2  7 1

7 4  7 11  9  8  8 10  8 13  7  2  9  6  9 11  7  2  7 9

;

proc freq data=icecream;

run;

Contributor
Posts: 50

## Re: Help with Weight example from SAS Website

yep that makes sense, thanks for the quick response!

🔒 This topic is solved and locked.