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 3 lists the available statistic-options and the exact statistics that are computed. Descriptions of the statistic-options follow Table 3 in alphabetical order.

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

For two-sample data, PROC NPAR1WAY also provides the exact Kolmogorov-Smirnov test, the exact ratio mean deviations (RMD) test, and exact Hodges-Lehmann confidence limits for the 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 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
RMD Ratio mean deviations (RMD) 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:

AB

requests an 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 an 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 an 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 an exact Kolmogorov-Smirnov two-sample test. For more information, see the section Empirical Distribution Function Tests. 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 an 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 an 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.

RMD

requests the ratio mean deviations (RMD) exact test for two-sample data. For more information, see the sections Ratio Mean Deviations (RMD) Exact Test and Exact Tests.

SAVAGE

requests an 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 an 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 an 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 an 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 an 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:

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 left-parenthesis 1 minus alpha right-parenthesis% confidence limits. By default, ALPHA=0.01, which produces 99% confidence limits for the exact p-values.

This 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 exact p-value computation and for Monte Carlo estimation of exact p-values. 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 where exact computations require a substantial amount of time and memory but 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. Larger values of n produce more precise estimates of exact p-values. Because larger values of n generate more samples, the computation time increases. By default, N=10,000.

This 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.

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 0, PROC NPAR1WAY uses the time of day from the computer’s clock to obtain the initial seed.

This option invokes the MC option.

Last updated: December 09, 2022