Chapter Contents

Previous

Next
The FREQ Procedure

OUTPUT Statement


Creates a SAS data set with the statistics that PROC FREQ computes for the last TABLES statement request. The variables contain statistics for each two-way table or stratum, as well as summary statistics across all strata.

Requirements: TABLES statement
Restriction: Only one OUTPUT statement is allowed.
Tip: Use the Output Delivery System to create a SAS data set from any piece of PROC FREQ output.
Main discussion: Output Data Sets
Featured in: Creating an Output Data Set Containing Chi-Square Statistics


OUTPUT statistic-keyword(s) <OUT=SAS-data-set>;


Options

OUT=SAS-data-set
names the output data set that contains statistics for the last TABLES statement request. If you omit OUT=, the data set is named DATAn, where n is the smallest integer that makes the name unique.
Default: DATAn

statistic-keyword(s)
specifies the statistics that you want in the new data set. Available statistics are those produced by PROC FREQ for each one-way or two-way table, as well as summary statistics across all strata. When you request a statistic, the OUTPUT data set contains that estimate or test statistic, as well as any associated standard error, degrees of freedom, confidence limits, and p-values.

You can save statistics by using keywords that are identical to group options in the TABLES statement: AGREE, ALL, CHISQ, CMH, and MEASURES. Alternatively, you can request an individual statistic by specifying a keyword shown in OUTPUT Statement Statistic-keywords and Required TABLES Statement Options .


Using the TABLES Statement with the OUTPUT Statement
In order to specify that the OUTPUT data set contain a particular statistic, you must have PROC FREQ compute the statistic by using the corresponding option in the TABLES statement or the EXACT statement. For example with a 2×2 table, you cannot specify the keyword OR (odds ratio) in the OUTPUT statement without also specifying ALL, MEASURES, or RELRISK in the TABLES 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.

OUTPUT Statement Statistic-keywords and Required TABLES Statement Options
Keyword 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 test. AGREE
AJCHI continuity-adjusted chi-square for 2×2 tables ALL, CHISQ
ALL all statistics under CHISQ, MEASURES, CMH, and the number of nonmissing subjects ALL
BDCHI Breslow-Day test ALL, CMH, CMH1, CMH2
BINOMIAL binomial proportion statistics for one-way tables 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, 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, CMH
CMH1 same as CMH, but excludes general association and row mean scores (ANOVA) statistics ALL, CMH, CMH1, CMH2
CMH2 same as CMH, but excludes the general association statistic ALL, CMH, CMH2
CMHCOR Cochran-Mantel-Haenszel correlation statistic ALL, CMH, CMH1, CMH2
CMHGA Cochran-Mantel-Haenszel general association statistic ALL, CMH
CMHRMS Cochran-Mantel-Haenszel row mean scores (ANOVA) statistic ALL, CMH, CMH2
COCHQ Cochran's Q AGREE
CONTGY contingency coefficient ALL, CHISQ
CRAMV Cramer's V ALL, CHISQ
EQKAP test for equal simple kappas AGREE
EQWKP test for equal weighted kappas AGREE
FISHER|EXACT Fisher's exact test ALL*, CHISQ*, FISHER, EXACT
GAMMA gamma ALL, MEASURES
JT Jonckheere-Terpstra test JT
KAPPA simple kappa coefficient AGREE
KENTB Kendall's tau-b ALL, MEASURES
LAMCR lambda asymmetric (C|R) ALL, MEASURES
LAMDAS lambda symmetric ALL, MEASURES
LAMRC lambda asymmetric (R|C) ALL, MEASURES
LGOR adjusted logit odds ratio ALL, CMH, CMH1, CMH2
LGRRC1 adjusted logit column 1 relative risk ALL, CMH, CMH1, CMH2
LGRRC2 adjusted logit column 2 relative risk ALL, CMH, CMH1, CMH2
LRCHI likelihood ratio chi-square ALL, 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 risks ALL, MEASURES
MHCHI Mantel-Haenszel chi-square ALL, CHISQ
MHOR adjusted Mantel-Haenszel odds ratio ALL, CMH, CMH1, CMH2
MHRRC1 adjusted Mantel-Haenszel column 1 relative risk ALL, CMH, CMH1, CMH2
MHRRC2 adjusted Mantel-Haenszel column 2 relative risk ALL, CMH, CMH1, CMH2
N number of nonmissing subjects for the stratum
NMISS number of missing subjects for the stratum
OR odds ratio ALL, MEASURES, RELRISK
PCHI chi-square goodness-of-fit test for one-way tables; for 2-way tables, Pearson chi-square ALL, CHISQ
PCORR Pearson correlation coefficient ALL, MEASURES
PHI phi coefficient ALL, 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, MEASURES, 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, MEASURES, RELRISK
RRC2 column 2 relative risk ALL, MEASURES, 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, MEASURES
SMDCR Somers' D (C|R) ALL, MEASURES
SMDRC Somers' D (R|C) ALL, MEASURES
STUTC Stuart's tau-c ALL, MEASURES
TREND Cochran-Armitage test for trend TREND
TSYMM Bowker's test of symmetry AGREE
U symmetric uncertainty coefficient ALL, MEASURES
UCR uncertainty coefficient (C|R) ALL, MEASURES
URC uncertainty coefficient (R|C) ALL, MEASURES
WTKAP weighted kappa coefficient AGREE
* ALL and CHISQ compute Fisher's exact test only for 2×2 tables. Use the FISHER option to compute Fisher's exact test for general r×c tables.


Chapter Contents

Previous

Next

Top of Page

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