SAS Base (56)

The following output is created by the FREQUENCY procedure:

Frequency
Percent
Row Pct
Col Pct
Table of Region by Product
Region Product
Corn Cotton Oranges Total
East
2
22.22
50.00
50.00
1
11.11
25.00
33.33
1
11.11
25.00
50.00
4
44.44
South
2
22.22
40.00
50.00
2
22.22
40.00
66.67
1
11.11
20.00
50.00
5
55.56
Total
4
44.44
3
33.33
2
22.22
9
100.00

Which TABLES statement was used to completed the following program
that produced the output?

proc freq data=sales;
<_insert_code_>
run;

A. tables region product;
B. tables region,product;
C. tables region/product;
D. tables region*product;

Check Answer
Answer: D

注解:Comma and slash are invalid symbols in TABLES statement. Asterisk is used to create  multi-way tables. By adding an asterisk between two variables, SAS creates a two-way crosstabulation table. In option A, using a space between two variables, SAS will create two one-way frequency tables:

Region Frequency Percent Cumulative
Frequency
Cumulative
Percent
East 4 44.44 4 44.44
South 5 55.56 9 100.00
Product Frequency Percent Cumulative
Frequency
Cumulative
Percent
Corn 4 44.44 4 44.44
Cotton 3 33.33 7 77.78
Oranges 2 22.22 9 100.00

SAS Base (47)

The following output is created by the FREQUENCY procedure:

Frequency
Percent
Row Pct
Col Pct
Table of region by product
region product
corn cotton oranges Total
EAST
2
22.22
50.00
50.00
1
11.11
25.00
33.33
1
11.11
25.00
50.00
4
44.44
SOUTH
2
22.22
40.00
50.00
2
22.22
40.00
66.67
1
11.11
20.00
50.00
5
55.56
Total
4
44.44
3
33.33
2
22.22
9
100.00

Which TABLES option(s) would be used to eliminate the

row and column counts and just see the frequencies and percents?

A. norowcount nocolcount
B. freq percent
C. norow nocol
D. nocounts

Check Answer
Answer: C

注解:RPOC FREQ statement用于生成Frequency Table。题目要求不显示Row Percent和Column Percent这个统计量,这仅需要在TABLES statement后加上NOROW和NOCOL选项,程序为:
proc freq data = dataset;
tables region * product / nocol norow;
run;
输出的结果为:

Frequency
Percent
Table of region by product
region product
corn cotton oranges Total
EAST
2
22.22
1
11.11
1
11.11
4
44.44
SOUTH
2
22.22
2
22.22
1
11.11
5
55.56
Total
4
44.44
3
33.33
2
22.22
9
100.00