Chapter Contents |
Previous |
Next |

The FREQ Procedure |

**OUTPUT***<***OUT=**SAS-data-set > options**;**

The OUTPUT statement creates a SAS data set containing statistics computed by PROC FREQ. The variables contain statistics for each two-way table or stratum, as well as summary statistics across all strata.

Only one OUTPUT statement is allowed for each execution of PROC FREQ. You must specify a TABLES statement with the OUTPUT statement. If you use multiple TABLES statements, the contents of the OUTPUT data set correspond to the last TABLES statement. If you use multiple table requests in a TABLES statement, the contents of the OUTPUT data set correspond to the last table request.

For more information, see the section "Output Data Sets".

Note that you can use the Output Delivery System (ODS) to create a SAS data set from any piece of PROC FREQ output. For more information, see Table 28.11 and Chapter 15, "Using the Output Delivery System."

You can specify the following options in an OUTPUT statement.

**OUT=***SAS-data-set*-
names the output data set.
If you omit the OUT= option, the data set is named
DATA
*n*, where*n*is the smallest integer that makes the name unique.

*options*- specifies the statistics that you want in the output data set.
Available statistics are those produced by PROC FREQ
for each one-way or two-way table, as well as the summary statistics
across all strata. When you request a statistic, the OUTPUT data set
contains that estimate or test statistic plus any associated
standard error, confidence limits,
*p*-values, and degrees of freedom. You can output statistics by using group options identical to those specified in the TABLES statement: AGREE, ALL, CHISQ, CMH, and MEASURES. Alternatively, you can request an individual statistic by specifying one of the options shown in the following table.**Table 28.7:**OUTPUT Statement Options and Required TABLES Statement Options**Option****Output Data Set Statistics****Required TABLES****Statement Option**AGREE McNemar's test for 2 ×2 tables, simple kappa coefficient, and weighted kappa coefficient; for square tables with more than two response categories, Bowker's test of symmetry; for multiple strata, overall simple and weighted kappa statistics, and tests for equal kappas among strata; for multiple strata with two response categories, Cochran's *Q*testAGREE AJCHI continuity-adjusted chi-square for 2 ×2 tables ALL or CHISQ ALL all statistics under CHISQ, MEASURES, and CMH, and the number of nonmissing subjects ALL BDCHI Breslow-Day test ALL or CMH or CMH1 or CMH2 BIN | BINOMIAL for one-way tables, binomial proportion statistics BINOMIAL CHISQ chi-square goodness-of-fit test for one-way tables; for two-way tables, Pearson chi-square, likelihood-ratio chi-square, continuity-adjusted chi-square for 2 ×2 tables, Mantel-Haenszel chi-square, Fisher's exact test for 2 ×2 tables, phi coefficient, contingency coefficient, and Cramer's *V*ALL or CHISQ CMH Cochran-Mantel-Haenszel correlation, row mean scores (ANOVA), and general association statistics; for 2 ×2 tables, logit and Mantel-Haenszel adjusted odds ratios, relative risks, and Breslow-Day test ALL or CMH CMH1 same as CMH, but excludes general association and row mean scores (ANOVA) statistics ALL or CMH or CMH1 CMH2 same as CMH, but excludes the general association statistic ALL or CMH or CMH2 CMHCOR Cochran-Mantel-Haenszel correlation statistic ALL or CMH or CMH1 or CMH2 CMHGA Cochran-Mantel-Haenszel general association statistic ALL or CMH CMHRMS Cochran-Mantel-Haenszel row mean scores (ANOVA) statistic ALL or CMH or CMH2 COCHQ Cochran's *Q*AGREE CONTGY contingency coefficient ALL or CHISQ CRAMV Cramer's *V*ALL or CHISQ EQKAP test for equal simple kappas AGREE EQWKP test for equal weighted kappas AGREE FISHER | EXACT Fisher's exact test ALL or CHISQ ^{*}GAMMA gamma ALL or MEASURES JT Jonckheere-Terpstra test JT KAPPA simple kappa coefficient AGREE KENTB Kendall's tau- *b*ALL or MEASURES LAMCR lambda asymmetric ( *C*|*R*)ALL or MEASURES LAMDAS lambda symmetric ALL or MEASURES LAMRC lambda asymmetric ( *R*|*C*)ALL or MEASURES LGOR adjusted logit odds ratio ALL or CMH or CMH1 or CMH2 LGRRC1 adjusted column 1 logit relative risk ALL or CMH or CMH1 or CMH2 LGRRC2 adjusted column 2 logit relative risk ALL or CMH or CMH1 or CMH2 LRCHI likelihood-ratio chi-square ALL or CHISQ MCNEM McNemar's test AGREE MEASURES gamma, Kendall's tau- *b*, Stuart's tau-*c*, Somers'*D*(*C*|*R*), Somers'*D*(*R*|*C*), Pearson correlation coefficient, Spearman correlation coefficient, lambda asymmetric (*C*|*R*), lambda asymmetric (*R*|*C*), lambda symmetric, uncertainty coefficient (*C*|*R*), uncertainty coefficient (*R*|*C*), and symmetric uncertainty coefficient; for 2 ×2 tables, odds ratio and relative risksALL or MEASURES MHCHI Mantel-Haenszel chi-square ALL or CHISQ MHOR adjusted Mantel-Haenszel odds ratio ALL or CMH or CMH1 or CMH2 MHRRC1 adjusted column 1 Mantel-Haenszel relative risk ALL or CMH or CMH1 or CMH2 MHRRC2 adjusted column 2 Mantel-Haenszel relative risk ALL or CMH or CMH1 or CMH2 N number of nonmissing subjects for the stratum NMISS number of missing subjects for the stratum OR odds ratio ALL or MEASURES or RELRISK PCHI chi-square goodness-of-fit test for one-way tables; for two-way tables, Pearson chi-square ALL or CHISQ PCORR Pearson correlation coefficient ALL or MEASURES PHI phi coefficient ALL or CHISQ PLCORR polychoric correlation coefficient PLCORR RDIF1 column 1 risk difference (row 1 - row 2) RISKDIFF RDIF2 column 2 risk difference (row 1 - row 2) RISKDIFF RELRISK odds ratio and relative risks for 2 ×2 tables ALL or MEASURES or RELRISK RISKDIFF risks and risk differences RISKDIFF RISKDIFF1 column 1 risks and risk difference RISKDIFF RISKDIFF2 column 2 risks and risk difference RISKDIFF RRC1 column 1 relative risk ALL or MEASURES or RELRISK RRC2 column 2 relative risk ALL or MEASURES or RELRISK RSK1 column 1 risk (overall) RISKDIFF RSK11 column 1 risk, for row 1 RISKDIFF RSK12 column 2 risk, for row 1 RISKDIFF RSK2 column 2 risk (overall) RISKDIFF RSK21 column 1 risk, for row 2 RISKDIFF RSK22 column 2 risk, for row 2 RISKDIFF SCORR Spearman correlation coefficient ALL or MEASURES SMDCR Somers' *D*(*C*|*R*)ALL or MEASURES SMDRC Somers' *D*(*R*|*C*)ALL or MEASURES STUTC Stuart's tau- *c*ALL or MEASURES TREND Cochran-Armitage test for trend TREND TSYMM Bowker's test of symmetry AGREE U symmetric uncertainty coefficient ALL or MEASURES UCR uncertainty coefficient ( *C*|*R*)ALL or MEASURES URC uncertainty coefficient ( *R*|*C*)ALL or MEASURES WTKAP weighted kappa coefficient AGREE

Additionally, if you have only one TABLES statement, the EXACT statement option CHISQ or PCHI computes the Pearson chi-square.

Chapter Contents |
Previous |
Next |
Top |

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.