# cJCK: Computes a critical value for the Jonckheere-Terpstra J... 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 Jonckheere-Terpstra J distribution at (or typically in the "Exact" case, close to) the given alpha level. The function takes advantage of Harding's (1984) algorithm to quickly generate the distribution.

## Usage

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

## Arguments

 `alpha` A numeric value between 0 and 1. `n` A vector of numeric values indicating the size of each of the k data groups. `method` Either "Exact" or "Asymptotic", indicating the desired distribution. When method=NA, if sum(n)<=200, the "Exact" method will be used to compute the J distribution. Otherwise, the "Asymptotic" method will be used. `n.mc` Not used. Only included for standardization with other critical value procedures in the NSM3 package.

## Value

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

 `n` number of observations in the k data groups `cutoff.U` upper tail cutoff at or below user-specified alpha `true.alpha.U` true alpha level corresponding to cutoff.U (if method="Exact")

Grant Schneider

## References

Harding, E. F. "An efficient, minimal-storage procedure for calculating the Mann-Whitney U, generalized U and similar distributions." Applied statistics (1984): 1-6.

## Examples

 ```1 2 3 4``` ```##Hollander-Wolfe-Chicken Example 6.2 Motivational Effect of Knowledge of Performance cJCK(.0490, c(6,6,6),"Exact") cJCK(.0490, c(6,6,6),"Monte Carlo") cJCK(.0231, c(6,6,6),"Exact") ```

### Example output

```Loading required package: combinat

Attaching package: ‘combinat’

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

combn

Group sizes: 6 6 6
For the given alpha=0.049, the upper cutoff value is Jonckheere-Terpstra J=75,
with true alpha level=0.049
Group sizes: 6 6 6
For the given alpha=0.049, the upper cutoff value is Jonckheere-Terpstra J=75,
with true alpha level=0.049
Warning message:
In cJCK(0.049, c(6, 6, 6), "Monte Carlo") :
The exact computation will work for large data, so Monte Carlo methods
are not recommended for this procedure.
Group sizes: 6 6 6
For the given alpha=0.0231, the upper cutoff value is Jonckheere-Terpstra J=79,
with true alpha level=0.0231
```

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