The NPAR1WAY Procedure

EXACT Statement

  • EXACT statistic-options < / computation-options> ;

The EXACT statement requests exact tests and confidence limits for selected statistics. The statistic-options identify which statistics to compute, and the computation-options specify options for computing exact statistics. For more information, see the section Exact Tests.

Note: PROC NPAR1WAY computes exact tests by using fast and efficient algorithms that are superior to direct enumeration. Exact tests are appropriate when a data set is small, sparse, skewed, or heavily tied. For some large problems, computation of exact tests might require a large amount of time and memory. Consider using asymptotic tests for such problems. Alternatively, when asymptotic methods might not be sufficient for such large problems, consider using Monte Carlo estimation of exact p-values. You can request Monte Carlo estimation by specifying the MC computation-option in the EXACT statement. For more information, see the section Computational Resources.

Statistic Options

The statistic-options specify which exact tests to compute. Table 71.3 lists the available statistic-options and the exact statistics that are computed. Descriptions of the statistic-options follow Table 71.3 in alphabetical order.

Exact p-values are available for all nonparametric tests of location and scale differences that are produced by PROC NPAR1WAY. These include tests based on the following scores: Wilcoxon, median, Van der Waerden (normal), Savage, Siegel-Tukey, Ansari-Bradley, Klotz, Mood, and Conover. Additionally, exact p-values are available for tests that use the raw input data as scores. The procedure computes exact p-values when the data are classified into two levels (two-sample tests) and when the data are classified into more than two levels (multisample tests). Two-sample tests are based on simple linear rank statistics. Multisample tests are based on one-way ANOVA statistics.

Exact p-values are also available for the two-sample Kolmogorov-Smirnov test. Exact confidence limits are available for the Hodges-Lehmann estimate of location shift.

If you list no statistic-options in the EXACT statement, PROC NPAR1WAY computes all available exact p-values for those tests that you request in the PROC NPAR1WAY statement.

Table 71.3: EXACT Statement Statistic Options

Statistic Option

Exact Test

AB

Ansari-Bradley test

CONOVER

Conover test

HL

Hodges-Lehmann confidence limits

KLOTZ

Klotz test

KS | EDF

Two-sample Kolmogorov-Smirnov test

MEDIAN

Median test

MOOD

Mood test

SAVAGE

Savage test

SCORES=DATA

Test with input data as scores

ST

Siegel-Tukey test

VW | NORMAL

Van der Waerden (normal scores) test

WILCOXON

Wilcoxon test for two-sample data or

 

Kruskal-Wallis test for multisample data


You can specify the following statistic-options in the EXACT statement.

AB

requests the exact Ansari-Bradley test. For more information, see the sections Ansari-Bradley Scores and Exact Tests. The AB option in the PROC NPAR1WAY statement provides Ansari-Bradley score analysis and asymptotic tests.

CONOVER

requests the exact Conover test. For more information, see the sections Conover Scores and Exact Tests. The CONOVER option in the PROC NPAR1WAY statement provides Conover score analysis and asymptotic tests.

HL

requests exact Hodges-Lehmann confidence limits for the location shift for two-sample data. For more information, see the section Hodges-Lehmann Estimation of Location Shift. The HL option in the PROC NPAR1WAY statement provides asymptotic Hodges-Lehmann confidence limits.

You can specify the level of the confidence limits in the ALPHA= option in the PROC NPAR1WAY statement. By default, ALPHA=0.05, which produces 95% confidence limits for the location shift.

KLOTZ

requests the exact Klotz test. For more information, see the sections Klotz Scores and Exact Tests. The KLOTZ option in the PROC NPAR1WAY statement provides Klotz score analysis and asymptotic tests.

KS
EDF

requests the exact Kolmogorov-Smirnov two-sample test. For more information, see the section Tests Based on the Empirical Distribution Function. The EDF option in the PROC NPAR1WAY statement provides the asymptotic Kolmogorov-Smirnov test and other statistics that are based on the empirical distribution function. The D option in the PROC NPAR1WAY statement provides the asymptotic one-sided Kolmogorov-Smirnov tests for two-sample data.

MEDIAN

requests the exact median test. For more information, see the sections Median Scores and Exact Tests. The MEDIAN option in the PROC NPAR1WAY statement provides median score analysis and asymptotic tests.

MOOD

requests the exact Mood test. For more information, see the sections Mood Scores and Exact Tests. The MOOD option in the PROC NPAR1WAY statement provides Mood score analysis and asymptotic tests.

SAVAGE

requests the exact Savage test. For more information, see the sections Savage Scores and Exact Tests. The SAVAGE option in the PROC NPAR1WAY statement provides Savage score analysis and asymptotic tests.

SCORES=DATA
PERM

requests the exact test that uses the input data as scores. For two-sample data, the test is based on the rank-sum statistic. For multisample data, the test is based on the one-way ANOVA statistic. For more information, see the sections Scores for Linear Rank and One-Way ANOVA Tests and Exact Tests. The SCORES=DATA option in the PROC NPAR1WAY statement provides analysis of the data scores and the corresponding asymptotic test.

ST

requests the exact Siegel-Tukey test. For more information, see the sections Siegel-Tukey Scores and Exact Tests. The ST option in the PROC NPAR1WAY statement provides analysis of Siegel-Tukey scores and asymptotic tests.

VW
NORMAL

requests the exact Van der Waerden (normal scores) test. For more information, see the sections Van der Waerden (Normal) Scores and Exact Tests. The VW (NORMAL) option in the PROC NPAR1WAY statement provides analysis of Van der Waerden (normal) scores and asymptotic tests.

WILCOXON

requests the exact Wilcoxon test. When the data consist of two classification levels (samples), the exact test is based on the Wilcoxon rank-sum statistic. When the data consist of more than two levels (multisample data), the exact test is based on the one-way ANOVA statistic for Wilcoxon scores, which is the Kruskal-Wallis statistic. For more information, see the sections Wilcoxon Scores and Exact Tests. The WILCOXON option in the PROC NPAR1WAY statement provides analysis of Wilcoxon scores and the asymptotic Wilcoxon and Kruskal-Wallis tests.

Computation Options

Computation-options specify options for computing exact statistics. You can specify the following computation-options in the EXACT statement after a slash (/).

ALPHA=$\alpha $

specifies the level of the confidence limits for Monte Carlo p-value estimates. The value of $\alpha $ must be between 0 and 1; a confidence level of $\alpha $ produces $100(1-\alpha )$% confidence limits. By default, ALPHA=0.01, which produces 99% confidence limits for the exact p-values.

The ALPHA= option invokes the MC option.

MAXTIME=value

specifies the maximum clock time (in seconds) that PROC NPAR1WAY can use to compute an exact p-value. If the procedure does not complete the computation within the specified time, the computation terminates. The maximum time value must be a positive number. This option is available for Monte Carlo estimation of exact p-values as well as for direct exact p-value computation. For more information, see the section Computational Resources.

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 considerable amount of time and memory for exact computations but for which asymptotic approximations might not be sufficient. For more information, see the section Monte Carlo Estimation.

This option is available for all EXACT statistic-options except the HL option, which produces exact Hodges-Lehmann confidence limits. The ALPHA= , N= , and SEED= options invoke the MC option.

MIDP

requests exact mid p-values for the exact tests. The exact mid p-value is defined as the exact p-value minus half the exact point probability. For two-sample data, PROC NPAR1WAY provides exact mid p-values for the one-sided tests of the linear rank statistics. For multisample data, PROC NPAR1WAY provides exact mid p-values for the one-way ANOVA tests. For more information, see the section Definition of p-Values.

The MIDP option is available for all EXACT statement statistic-options except the HL option, which produces exact Hodges-Lehmann confidence limits. You cannot specify both the MIDP option and the MC option.

N=n

specifies the number of samples for Monte Carlo estimation. The value of n must be a positive integer, and the default is 10,000 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.

PFORMAT=format-name | EXACT

specifies the display format for exact p-values. PROC NPAR1WAY applies this format to one- and two-sided exact p-values, exact point probabilities, and exact mid p-values. By default, PROC NPAR1WAY displays exact p-values in the PVALUE6.4 format.

You can provide a format-name or you can specify PFORMAT=EXACT to control the format of exact p-values. The value of format-name can be any standard SAS numeric format or a user-defined format. The format length must not exceed 24. For information about formats, see the FORMAT procedure in the Base SAS Procedures Guide and the FORMAT statement and SAS format in SAS Formats and Informats: Reference.

If you specify PFORMAT=EXACT, PROC NPAR1WAY uses the 6.4 format to display exact p-values that are greater than or equal to 0.001; the procedure uses the E10.3 format to display values that are between 0.000 and 0.001. This is the format that PROC NPAR1WAY uses to display exact p-values in releases before SAS/STAT 12.3. Beginning in SAS/STAT 12.3, by default PROC NPAR1WAY uses the PVALUE6.4 format to display exact p-values.

POINT

requests exact point probabilities for the exact tests. The exact point probability is the exact probability that the test statistic equals the observed value. For two-sample data, PROC NPAR1WAY provides exact point probabilities for the one-sided tests of the linear rank statistics. For multisample data, PROC NPAR1WAY provides exact point probabilities for the one-way ANOVA tests. For more information, see the section Definition of p-Values.

The POINT option is available for all EXACT statement statistic-options except the HL option, which produces exact Hodges-Lehmann confidence limits. You cannot specify both the POINT option and 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 an integer. If you do not specify the SEED= option or if the SEED= value is negative or zero, PROC NPAR1WAY uses the time of day from the computer’s clock to obtain the initial seed.

The SEED= option invokes the MC option.