49.0 FREQ Command
The FREQ command produces series frequency tables and simple cross
tabulation tables. For complex cross tabulations it is suggested that
a branch be made to SAS(r). The FREQ command handles missing data but
does not handle character data at this time. The main objective of the
cross tabulation option of the FREQ command (called by the TABLE
sentence) is to allow analysis of residual outliers. Cross tabulation
of the residual or the absolute value of the residual against right
hand side or potential right hand side variables can be used in the
identification stage of equation estimation.
Form of FREQ command.
B34SEXEC FREQ options parameters$
VAR $
TABLE options parameters$
B34SEEND$
Options of FREQ sentence.
VERTHIST - Graphically display results in a vertical histogram.
HORIZHIST - Horizontally display data in a horizontal histogram.
NOFREQ - Suppress frequency analysis. Used if TABLE is
present and only cross tabulations are desired.
Pamameters on FREQ sentence.
IBEGIN=n1 Sets first observation to use. Default = 1.
IEND=n2 Sets last observation to use. Default = last observation
in dataset.
TYPE = key Sets type of frequency analysis done. Options are:
EQUIDISTANT - Sets equidistant ranges.
USERGROUP - User sets groups from RANGE sentence.
EVALUES - Uses exact values. For n observations
this option could product a max of
n frequencies. This is default.
NRANGE = Sets number of ranges for TYPE=EQUIDISTANT. Default = 10.
RANGE(R1, R2, R3) User sets ranges. These must be increasing. If
this option is used, then these ranges are
used for all series. If this is not desired
then, use the VAR sentence and make multiple
calls to the FREQ command. A max of 200 values
can be supplied.
Notes: Unless the default TYPE=EVALUES is in effect, ranges are set for
variables. If this is not desired, then it is recommended that the
FREQ command be called for each variable or the TYPE=EQUIDISTANT option.
VAR sentence.
The var sentence is used to specify the variables to analyse.
If this sentence is not present, all non character variables will
be analysed.
TABLE sentence.
The TABLE sentence sets up variables to analyse using cross
tabulations.
TABLE sentence options
EXACT - Calculate Exact probabilities for Contingency table. This
calculation can take a great deal of time. For references
1. Cantor, Alan "A computer algorithm for testing
significance in M by K contingency tables," Psycometrika
44(1) 1979 75-83
2. Freeman, G. H. and J. H. Halton "Note on an exact
treatment of contingency, goodness of fit and other
problems of significance", Biometrika 38, 1951,
141-149.
3. Hancock, T. W. "Algorithm 434," Comm. ACM 18(2) 1975,
117-119.
4. March, D. L. "Algorithm 434: Exact probabilities for
R x C contigency tables," omm. ACM. 15(11) 1972,
991-992.
TABLE sentence parameters.
TYPEX = key Sets type of cross tabs done for x. Options are:
EQUIDISTANT - Sets equidistant ranges.
USERGROUP - User sets groups from RANGE sentence.
EVALUES - Uses exact values. For n observations
this option could product a max of
n frequencies. This is default.
NRANGEX = Sets number of ranges for TYPEX=EQUIDISTANT. Default = 10.
RANGEX(R1, R2, R3) User sets ranges. These must be increasing.
A max of 200 values can be supplied.
TYPEY = key Sets type of cross tabs done for Y. Options are:
EQUIDISTANT - Sets equidistant ranges.
USERGROUP - User sets groups from RANGE sentence.
EVALUES - Uses exact values. For n observations
this option could product a max of
n frequencies. This is default.
NRANGEY = Sets number of ranges for TYPEY=EQUIDISTANT. Default = 10.
RANGEY(R1, R2, R3) User sets ranges. These must be increasing.
A max of 200 values can be supplied.
Example # 1.
User wants to obtain frequency distrubutions for all non
character variables. This option may produce a great
deal of output since there are potentially N catagories.
b34sexec freq$
b34srun$
Example # 2.
Same as example # 1 except want to look at x and y only.
b34sexec freq$
var x y$
b34seend$
Example # 3.
Same as example # 1 except want to look at x and y only. Data will
be analysed into 5 groups.
b34sexec freq type=usergroup
range(.1 .2 .8 .9 .10)$
var x y$
b34seend$
Example # 4.
Same as example # 1 except want to look at x and y only. Data will
be analysed 10 equidistant groups.
b34sexec freq type=equidistant nrange=10$
var x y$
b34seend$
Example # 5.
User wants a cross tabulation between x and y. No frequency
plots are given
b34sexec freq nofreq$
table(x,y)$
b34seend$