Proc freq is used to perform one, two, and n way analysis of catagorical data. The typical invocation and options are
proc freq
data=info
page;
by x;
tables y*z
/chisq
expected
exact
sparse
nocum
nopercent
nocol
norow;
run;
The backslash MUST be used (once) to select any of the options of the
tables statement.
The data= line is required and specifies the data set to be
analyzed.
The page option specifies that only one table should appear on
each page. Without this specification, multiple tables will be
printed on each page as space permits.
The optional by statement produces separate analyses for each
value of the by variable(s).
The tables statement produces a table of values for analysis.
The form y*z produces a 2 way table with the values of y
defining table rows and the values of z defining table columns.
A 1 way table is obtained by specifying a single variable
name. Multiple tables may be requested within a single tables
statement. The short form (q1--q3)*a requests 3 tables and is
equivalent to q1*a q2*a q3*a. Note the double hyphen required here.
Options for the tables statement follow the /.
The chisq option to the tables statement performs the standard
Pearson chi-square test on the table(s) requested.
The expected option prints the expected number of observations
in each cell under the null hypothesis.
The exact option requests Fisher's exact test for the table(s).
This is automatically computed for 2 x 2 tables.
The sparse option produces a full table, even if the table has
many cells containing no observations.
The nocum option suppresses printing of cumulative frequencies
and percentages in the table.
The nopercent option suppresses printing of the cell percentages
and cumulative percentages.
The nocol and norow options suppress the printing of column
and row percentages.
For further information see the SAS/STAT User's Guide volume 1.
Copyright © 1997 by Jerry Alan Veeh. All rights reserved.