Chapter Contents Previous Next
 The FREQ Procedure

EXACT Statement

EXACT statistic-options < / computation-options > ;

The EXACT statement requests exact tests or confidence limits for the specified statistics. Optionally, PROC FREQ computes Monte Carlo estimates of the exact p-values. The statistic-options specify the statistics for which to provide exact tests or confidence limits. The computation-options specify options for the computation of exact statistics.

Warning: For some large problems, computation of exact tests may require a large amount of time and memory. Consider using asymptotic tests for such problems. Alternatively, when asymptotic methods may not be sufficient for such large problems, consider using Monte Carlo estimation of exact p-values. See the section "Computational Resources" for more information.

Statistic-Options

The statistic-options specify the statistics for which exact tests or confidence limits are computed. PROC FREQ can compute exact p-values for the following hypothesis tests: chi-square goodness-of-fit test for one-way tables; Pearson chi-square, likelihood-ratio chi-square, Mantel-Haenszel chi-square, Fisher's exact test, Jonckheere-Terpstra test, Cochran-Armitage test for trend, and McNemar's test for two-way tables. PROC FREQ can also compute exact p-values for tests of the following statistics: Pearson correlation coefficient, Spearman correlation coefficient, simple kappa coefficient, and weighted kappa coefficient. PROC FREQ can compute exact p-values for the binomial proportion test for one-way tables, as well as exact confidence limits for the binomial proportion. Additionally, PROC FREQ can compute exact confidence limits for odds ratios for 2 ×2 tables.

Table 28.6 lists the available statistic-options and the exact statistics computed. The option names are identical to the corresponding options in the TABLES statement and the OUTPUT statement. You can request exact computations for groups of statistics by using options that are identical to the following TABLES statement options: CHISQ, MEASURES, and AGREE. For example, when you specify the CHISQ option in the EXACT statement, PROC FREQ computes exact p-values for the Pearson chi-square, likelihood-ratio chi-square, and Mantel-Haenszel chi-square tests. You request exact p-values for an individual test by specifying one of the statistic-options shown in Table 28.6.

Table 28.6: EXACT Statement Statistic-Options
 Option Exact Statistics Computed AGREE McNemar's test for 2 ×2 tables, simple kappa coefficient, and weighted kappa coefficient BINOMIAL binomial proportion test for one-way tables CHISQ chi-square goodness-of-fit test for one-way tables; Pearson chi-square, likelihood-ratio chi-square, and Mantel-Haenszel chi-square tests for two-way tables FISHER Fisher's exact test JT Jonckheere-Terpstra test KAPPA test for the simple kappa coefficient LRCHI likelihood-ratio chi-square test MCNEM McNemar's test MEASURES tests for the Pearson correlation and the Spearman correlation, and the odds ratio confidence limits for 2 ×2 tables MHCHI Mantel-Haenszel chi-square test OR odds ratio confidence limits for 2 ×2 tables PCHI Pearson chi-square test PCORR test for the Pearson correlation coefficient SCORR test for the Spearman correlation coefficient TREND Cochran-Armitage test for trend WTKAP test for the weighted kappa coefficient

Computation-Options

The computation-options specify options for computation of exact statistics. You can specify the following computation-options in the EXACT statement.

ALPHA=
specifies the confidence level for the confidence limits for the Monte Carlo p-value estimates. The value of the ALPHA= option must be between 0.0001 and 0.9999, and the default is 0.01. A confidence level of results in % confidence limits. The default of ALPHA=.01 results in 99% confidence limits. If is between 0 and 1 but is outside the range of 0.0001 to 0.9999, PROC FREQ uses the closest range endpoint. For example, if you specify ALPHA=0.000001, PROC FREQ uses 0.0001 to determine confidence limits. The ALPHA= option invokes the MC option.

MAXTIME=value
specifies the maximum clock time (in seconds) that PROC FREQ can use to compute an exact p-value. If the procedure does not complete the computation within the specified time, the computation terminates. The value of the MAXTIME= option must be a positive number. The MAXTIME= option is valid for Monte Carlo estimation of exact p-values, as well as for direct exact p-value computation.

MC
requests Monte Carlo estimation of exact p-values instead of direct exact p-value computation. Monte Carlo estimation can be useful for large problems that require a great amount of time and memory for exact computations but for which asymptotic approximations may not be sufficient. The MC option is available for all EXACT statistic-options except BINOMIAL, MCNEM, and OR. PROC FREQ computes only exact tests or confidence limits for those statistics.

The ALPHA=, N=, or SEED= option also invokes the MC option.

N=n
specifies the number of samples for Monte Carlo estimation. The value of the N= option must be a positive integer, and the default is 10000 samples. Larger values of n produce more precise estimates of exact p-values. Because larger values of n generate more samples, the computation time increases. The N= option invokes the MC option.

SEED=number
specifies the initial seed for random number generation for Monte Carlo estimation. The value of the SEED= option must be a positive integer. If you do not specify the SEED= option, PROC FREQ uses the time of day from the computer's clock to obtain the initial seed. The SEED= option invokes the MC option.

Using TABLES Statement Options with the EXACT Statement

If you use only one TABLES statement, you do not need to specify options in the TABLES statement that are identical to options appearing in the EXACT statement. PROC FREQ automatically invokes the corresponding TABLES statement option when you specify the option in the EXACT statement. However, when you use multiple TABLES statements and want exact computations, you must specify options in the TABLES statement to compute the desired statistics. PROC FREQ then performs exact computations for all statistics that are also specified in the EXACT statement.

 Chapter Contents Previous Next Top