# cWNMT: Computes a critical value for the Wilcoxon, Nemenyi,... In NSM3: Functions and Datasets to Accompany Hollander, Wolfe, and Chicken - Nonparametric Statistical Methods, Third Edition

## Description

This function computes the critical value for the Wilcoxon, Nemenyi, McDonald-Thompson R distribution at (or typically in the "Exact" and "Monte Carlo" cases, close to) the given alpha level.

## Usage

 `1` ```cWNMT(alpha, k, n, method=NA, n.mc=10000) ```

## Arguments

 `alpha` A numeric value between 0 and 1. `k` A numeric value indicating the number of treatments. `n` A numeric value indicating the number of blocks. `method` Either "Exact", "Monte Carlo" or "Asymptotic", indicating the desired distribution. When method=NA, "Exact" will be used if the number of permutations is 10,000 or less. Otherwise, "Monte Carlo" will be used. `n.mc` If method="Monte Carlo", the number of Monte Carlo samples used to estimate the distribution. Otherwise, not used.

## Value

Returns a list with "NSM3Ch7c" class containing the following components:

 `k` number of treatments `n` number of blocks `cutoff.U` upper tail cutoff at or below user-specified alpha `true.alpha.U` true alpha level corresponding to cutoff.U (if method="Exact" or "Monte Carlo")

Grant Schneider

## Examples

 ```1 2 3 4 5 6 7``` ```##Hollander-Wolfe-Chicken Example 7.3 Rounding First Base #cWNMT(.047, 3, 15) cWNMT(.047, 3, 15,n.mc=5000) ##Chapter 7 Comment 26 #cWNMT(.083, 4, 2) cWNMT(.083, 4, 2,n.mc=5000) ```

### Example output

```Loading required package: combinat

Attaching package: ‘combinat’

The following object is masked from ‘package:utils’:

combn

Loading required package: MASS
Loading required package: partitions
Loading required package: survival

Monte Carlo Approximation (with 5000 Iterations) used:

Number of blocks: n=15
Number of treatments: k=3
For the given alpha=0.047, the upper cutoff value is Wilcoxon, Nemenyi, McDonald-Thompson R=14, with true alpha level=0.0332
Number of blocks: n=2
Number of treatments: k=4
For the given alpha=0.083, the upper cutoff value is Wilcoxon, Nemenyi, McDonald-Thompson R=NA, with true alpha level=NA
Warning messages:
1: In max(which(upper.tails[, 2] <= alpha)) :
no non-missing arguments to max; returning -Inf
2: In cWNMT(0.083, 4, 2, n.mc = 5000) :
NAs introduced by coercion to integer range
3: In max(which(upper.tails[, 2] <= alpha)) :
no non-missing arguments to max; returning -Inf
4: In cWNMT(0.083, 4, 2, n.mc = 5000) :
NAs introduced by coercion to integer range
```

NSM3 documentation built on April 6, 2021, 5:05 p.m.