# 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. See the section Exact Tests for details.

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. See the section Computational Resources for more information.

#### Statistic Options

The statistic-options specify which exact tests to compute. Table 65.3 lists the available statistic-options and the exact statistics that are computed. Descriptions of the statistic-options follow Table 65.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, then PROC NPAR1WAY computes all available exact p-values for those tests that you request in the PROC NPAR1WAY statement.

Table 65.3: EXACT Statement Statistic Options

Statistic Option

Exact Test

Conover test

Hodges-Lehmann confidence limits

Klotz test

Two-sample Kolmogorov-Smirnov test

Median test

Mood test

Savage test

Test with input data as scores

Siegel-Tukey test

Van der Waerden (normal scores) test

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. See the sections Ansari-Bradley Scores and Exact Tests for details. The AB option in the PROC NPAR1WAY statement provides Ansari-Bradley score analysis and asymptotic tests.

CONOVER

requests the exact Conover test. See the sections Conover Scores and Exact Tests for details. 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. See the section Hodges-Lehmann Estimation of Location Shift for details. The HL option in the PROC NPAR1WAY statement provides asymptotic Hodges-Lehmann confidence limits.

You can specify the level of the confidence limits by using the ALPHA= option in the PROC NPAR1WAY statement. The default of ALPHA=0.5 produces 95% confidence limits for the location shift.

KLOTZ

requests the exact Klotz test. See the sections Klotz Scores and Exact Tests for details. 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. See the section Tests Based on the Empirical Distribution Function for details. 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. See the sections Median Scores and Exact Tests for details. The MEDIAN option in the PROC NPAR1WAY statement provides median score analysis and asymptotic tests.

MOOD

requests the exact Mood test. See the sections Mood Scores and Exact Tests for details. The MOOD option in the PROC NPAR1WAY statement provides Mood score analysis and asymptotic tests.

SAVAGE

requests the exact Savage test. See the sections Savage Scores and Exact Tests for details. The SAVAGE option in the PROC NPAR1WAY statement provides Savage score analysis and asymptotic tests.

SCORES=DATA

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. See the sections Scores for Linear Rank and One-Way ANOVA Tests and Exact Tests for details. 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. See the sections Siegel-Tukey Scores and Exact Tests for details. 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. See the sections Van der Waerden (Normal) Scores and Exact Tests for details. The VW 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. See the sections Wilcoxon Scores and Exact Tests for details. 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= specifies the level of the confidence limits for Monte Carlo p-value estimates. The value of must be between 0 and 1, and the default is 0.01. A confidence level of produces % confidence limits. The default of ALPHA=0.01 produces 99% confidence limits for the Monte Carlo estimates.

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 value of MAXTIME= must be a positive number. The MAXTIME= option is valid for Monte Carlo estimation of exact p-values as well as direct exact p-value computation. See the section Computational Resources for more information.

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. See the section Monte Carlo Estimation for more information.

The MC 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 also invoke 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.

POINT

requests exact point probabilities for the test statistics.

The POINT option is available for all EXACT statement statistic-options except the HL option, which produces exact Hodges-Lehmann confidence limits. The POINT option is not available with 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.