Control • Say you want only the contingency table and the chi-square statistic… • Play with the code.
Not needed Fix the file name. Remove the extra stuff
crosstabfreqs Notice the output is generating two tables. I want to know the names so I can cut down the second table to only include the first Chi-Square. chisq
Request the names of the output tables in the log Turn it off.
ODS voodoo • For procedures that generate a lot of outputtables you can tell it which to select or exclude. • You can tell SAS to save the output of a table into a dataset (usually in the work library).
Same info in work and the report
Notice the filter Print Chi-square
Remember the ;
This works but has an extra table
Don’t display the statistics • You can turn off all the output and still have it write the table of statistics into the work The ODS destination name library.
Print the table without doing the statistics. Calculate the chi-square Solution
Cleaning Up • Macros (and other SAS programs) often use temporary datasets. It is good form to delete them. This code silently deletes the. Chi table from the work library: