This example
-
uses the CLASSDATA= option to specify combinations
of class variables to appear in a table
-
uses the EXCLUSIVE option to restrict the output
to only the combinations specified in the CLASSDATA= data set. Without the
EXCLUSIVE option, the output would be the same as in Creating a Basic Two-Dimensional Table.
|
data classes;
input region division type;
datalines;
1 1 1
1 1 2
4 4 1
4 4 2
; |
|
options nodate pageno=1 linesize=80 pagesize=60; |
|
proc tabulate data=energy format=dollar12.
classdata=classes exclusive;
|
|
class region division type; |
|
var expenditures; |
|
table region*division,
type*expenditures |
|
/ rts=25; |
|
format region regfmt. division divfmt. type usetype.; |
|
title 'Energy Expenditures for Each Region';
title2 '(millions of dollars)';
run; |
Energy Expenditures for Each Region 1
(millions of dollars)
---------------------------------------------------
| | Type |
| |-------------------------|
| |Residential | Business |
| | Customers | Customers |
| |------------+------------|
| |Expenditures|Expenditures|
| |------------+------------|
| | Sum | Sum |
|-----------------------+------------+------------|
|Region |Division | | |
|-----------+-----------| | |
|Northeast |New England| $7,477| $5,129|
|-----------+-----------+------------+------------|
|West |Pacific | $13,959| $12,619|
---------------------------------------------------
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.