3
<!-- This file has been generated by unroff 1.0, 03/01/02 09:13:44. -->
5
<STYLE TYPE="text/css">
7
A:link{text-decoration:none}
8
A:visited{text-decoration:none}
9
A:active{text-decoration:none}
12
<title>ploticus: proc tabulate</title>
13
<body bgcolor=D0D0EE vlink=0000FF>
17
<table cellpadding=2 bgcolor=FFFFFF width=550 ><tr>
19
<table cellpadding=2 width=550><tr>
20
<td><br><h2>proc tabulate</h2></td>
23
<a href="../doc/Welcome.html"><img src="../doc/ploticus.gif" border=0></a><br>
24
<a href="../doc/Welcome.html">Welcome</a>
25
<a href="../gallery/index.html">Gallery</a>
26
<a href="../doc/Contents.html">Handbook</a>
33
<title>Manual page for proc_tabulate(PL)</title>
39
<b>proc tabulate</b> may be used to compute a one-way distribution on one
40
data field, or a two-way distribution using two data fields.<tt> </tt>
41
The results are then considered the "current"
42
data set for plotting.
44
<b>proc tabulate</b> has a capacity of 200 result rows and
45
60 result columns.<tt> </tt>
46
Data does not have to be ordered in any particular way.<tt> </tt>
47
See also the <b>proc processdata</b> <tt>count</tt> action, which requires
48
ordered data but has no upper limit on number of "bins".<tt> </tt>
50
The <tt>savetable</tt> feature is recommended so that you can see
51
what the data set will look like when developing a plot.<tt> </tt>
54
Can tabulate to produce one- or two-way distributions.
55
Bins may be based on natural occurance or by preset lists or ranges.
56
Percents may be calculated. Ordering of results may be controlled.<tt> </tt>
57
Occurances may be counted, or accumulations may be done.<tt> </tt>
58
Resulting text table may be displayed on screen or saved for other uses.<tt> </tt>
61
See the Gallery examples
62
<a href="../gallery/distrib.htm">
66
<a href="../gallery/vermonth.htm">
70
<h2>PREREQUISITES</h2>
71
<b>proc getdata</b> must first be executed to define or access some data.<tt> </tt>
73
<h2>VARIABLES SET</h2>
75
<b>NROWS</b> = Number of rows in the data result.<tt> </tt>
77
<b>NFIELDS</b> = Number of fields per row in the data result.<tt> </tt>
79
Thus, if a one-way distribution is being done and there are 7 varieties,
80
NRECORDS will hold 7, which may then be used (e.g. xrange: @NRECORDS+1)
81
to automatically set scaling for a bargraph.<tt> </tt>
85
Either one-dimensional or two-dimensional modes.<tt> </tt>
87
If <tt>datafield1</tt> is specified but <tt>datafield2</tt> is not,
88
a <b>one-dimensional</b> distribution will be computed.<tt> </tt>
89
The result will be two data fields-- the first field
90
will be the value and the second field will be the number of
91
instances. The number of records in the result will be
92
the number of bins.<tt> </tt>
94
If both <tt>datafield1</tt> and <tt>datafield2</tt> are specified
95
then a <b>two-dimensional</b> distribution will be computed.<tt> </tt>
96
Datafield1 will be distributed downward and datafield2
97
will be distributed across.
98
The result's column headings will be usable as field names
99
(the first column is always named <tt>rowname</tt>).<tt> </tt>
101
Many of the attributes are named with either 1 or 2
102
to correspond with either the distribution on
103
datafield1, or datafield2.<tt> </tt>
106
After <b>proc tabulate</b> executes, all subsequent plotting
107
procedures in the script file will access its results
108
for plotting. However,
109
the original data is still in memory. If later it is
110
necessary to plot the original data, <b>proc originaldata</b>
111
may be invoked.<tt> </tt>
115
<h2>MANDATORY ATTRIBUTES</h2>
116
The <tt>datafield1</tt> attribute must be specified.<tt> </tt>
118
If a <tt>valuelist</tt> is not specified, all values encountered will
119
get their own bin in the distribution.<tt> </tt>
125
<a href="attributetypes.html#dfield">
130
Compute a distribution on this data field.<tt> </tt>
131
Value will be in result data field 1 and N will be
132
in result data field2.<tt> </tt>
133
Example: <tt>datafield1: 1</tt>
138
<a href="attributetypes.html#dfield">
143
Compute a two way distribution on datafield1 and this field.<tt> </tt>
144
Distribution on datafield2 will be horizontal.<tt> </tt>
145
See also MODES above.<tt> </tt>
146
Example: <tt>datafield2: 5</tt>
150
<b>axis1</b> <tt>x | y</tt>
153
Axis to equivicate with the distribution on datafield1.<tt> </tt>
154
This needs to be specified when working with
155
data which is to be scaled using units such as date or time.<tt> </tt>
156
Otherwise it does not need to be specified.<tt> </tt>
160
<b>axis2</b> <tt>x</tt>|<tt>y</tt>
163
Same as <tt>axis1</tt>.<tt> </tt>
167
<b>valuelist1</b> <i>stringlist</i>
170
Define a set of values that will be included in the distribution
171
of datafield1.<tt> </tt>
172
The ordering of this set determines the order that categories
173
are presented in the result.
174
This is a space- or comma-delimited list of values.
176
Example: <tt>valuelist: red green blue</tt>
178
If ranges are being used (<tt>dorange1: yes</tt>), then this attribute
179
may be used to explicitly define the ranges. See the following example for
180
the syntax; by default, dash (-) is used to separate the low and hi
181
values in a range, with no embedded spaces allowed.<tt> </tt>
183
As a convenience, the letter "C" may be used in
184
place of a low value in a range to
185
indicate "continuous"; its effect if for the previous high value to
186
be copied and taken as the next low value.<tt> </tt>
187
This saves the tedium and error-prone-ness
188
of having to enter values twice.<tt> </tt>
190
Example: <tt>valuelist1: 0-2.5 C-5 C-7.5 C-10</tt>
192
This would be equivalent to <tt>valuelist1: 0-2.5 2.5-5 5-7.5 7.5-10</tt>.<tt> </tt>
193
Either way, a value of 2.5 would end up in the 2nd bin.<tt> </tt>
200
Value list for datafield2. (see valuelist1)
204
<b>doranges1</b> <tt>yes | no</tt>
207
If <tt>yes</tt>, distribution on datafield1 will use ranges rather
208
than values. If defined ranges overlap the higher bin has presidence.<tt> </tt>
209
The ranges may be defined using either <tt>valuelist1</tt>, or
210
<tt>rangespec1</tt>.<tt> </tt>
214
<b>doranges2</b> <tt>yes | no</tt>
217
If <tt>yes</tt>, distribution on datafield2 will use ranges rather
219
The ranges may be defined using either <tt>valuelist2</tt>, or
220
<tt>rangespec2</tt>.<tt> </tt>
224
<b>rangespec1</b> <i>lowval binsize</i> [<i>hival</i>]
227
If doing ranges, this attribute may be used instead of <tt>valuelist</tt>
228
if ranges of uniform size are to be used when tabulating.<tt> </tt>
229
Ranges will begin at <i>lowval</i> and be of size <i>binsize</i>.<tt> </tt>
230
Ranges will end when <i>hival</i> is passed, or when the high end
231
of the axis is passed (if an axis has been defined).<tt> </tt>
232
<i>lowval</i> and <i>hival</i> should be
233
<a href="attributetypes.html#plotvalue">
236
. Implies <tt>doranges1: yes</tt>.<tt> </tt>
238
Example: <tt>rangespec1: 0 5 39</tt>
240
This would set up ranges 0-5, 5-10, 10-15, and so on, up to
241
35-40 (remember that where ranges overlap, the higher bin has presidence).<tt> </tt>
245
<b>rangespec2</b> <i>lowval binsize</i> [<i>hival</i>]
248
Same as <tt>rangespec1</tt>, but for datafield2.<tt> </tt>
253
<a href="attributetypes.html#dfield">
258
Normally, proc tabulate works by counting occurances. However,
259
If <tt>accumfield</tt> is specified, instead of counting, an accumulation
260
will be done using the specified field.<tt> </tt>
264
<b>order1</b> <tt>natural | magnitude | reversemagnitude</tt>
267
Specify order that categories are presented in the result.<tt> </tt>
271
<b>order2</b> <tt>natural | magnitude | reversemagnitude</tt>
274
Same as above for datafield2.<tt> </tt>
278
<b>percents</b> <tt>yes</tt> | <tt>no</tt>
281
If yes, each tabulation column will be accompanied by a column of percents.<tt> </tt>
285
<b>savetable</b> <i>filename</i> | <tt>stdout</tt> | <tt>stderr</tt>
288
If specified, write tabulation results to the
289
given file, standard output or standard error.<tt> </tt>
294
<a href="condex.html">
295
<i> conditional-expression </i>
299
<i>conditional-expression</i>
300
is applied to each data record (row).<tt> </tt>
301
If specified and if the expression evaluates to true, the
302
data is included; otherwise it is excluded.<tt> </tt>
303
Data fields are referenced by preceding them with
304
two at-signs (@).<tt> </tt>
306
Example: <tt>select: @4 = G</tt>
310
<b>rangesepchar</b> <i>char</i>
313
Allows user specification of the range separator character
314
(the character that should be used
315
to separate the low and high values of a range in the valuelists).<tt> </tt>
316
Default range separator charactor is dash (-).<tt> </tt>
317
Example: <tt>rangesepchar: ,</tt>
321
<b>showrange</b> <tt>low</tt> | <tt>avg</tt>
324
If specified, controls the content of row or column labels
325
when ranges are being used. Normal behavior is for the
326
label to be formatted <i>lowend</i><tt> - </tt><i>hiend</i>.<tt> </tt>
327
If this attribute is <tt>low</tt>, only the low value will be given.<tt> </tt>
328
If this attribute is <tt>avg</tt>, an average of the low and high
329
will be given.<tt> </tt>
330
This attribute is useful when proc tabulate result range bins will
331
be plotted by location, e.g. for a histogram (the 1st result data
332
field can be used as the bar location).<tt> </tt>
337
<b>showrangelowonly</b> <tt>yes | no</tt>
340
[Superceded by the <tt>showrange</tt> attribute.]
341
If <tt>yes</tt> and if ranges are being used, show only the low
342
part of the range in the results.
349
<a href="../doc/Welcome.html">
350
<img src="../doc/ploticus.gif" border=0></a><br><small>data display engine <br>
351
<a href="../doc/Copyright.html">Copyright Steve Grubb</a>
355
<img src="../gallery/all.gif">
361
Markup created by <em>unroff</em> 1.0, <tt> </tt> <tt> </tt>March 01, 2002.