# cFrd: Computes a critical value for the Friedman, Kendall-Babington... 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 Friedman, Kendall-Babington Smith S distribution at (or typically in the "Exact" and "Monte Carlo" cases, close to) the given alpha level. The method used to compute the distribution is from the reference by Van de Wiel, Bucchianico, and Van der Laan.

## Usage

 `1` ```cFrd(alpha, k, n, method=NA, n.mc=10000, return.full.distribution=FALSE) ```

## 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. `return.full.distribution` If TRUE, and the method used is not asymptotic, the entire probability mass function of S will be returned.

## 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") `full.distribution` probability mass function of S

Grant Schneider

## References

Van de Wiel, M. A., A. Di Bucchianico, and P. Van der Laan. "Symbolic computation and exact distributions of nonparametric test statistics." Journal of the Royal Statistical Society: Series D (The Statistician) 48.4 (1999): 507-516.

The `coin` package.

## Examples

 ```1 2 3 4``` ```##Hollander-Wolfe-Chicken Example 7.1 Rounding First Base #cFrd(0.01,3,22,"Exact") cFrd(0.01,3,22,n.mc=5000) cFrd(0.01,3,22,"Asymptotic") ```

### Example output

```Loading required package: combinat

Attaching package: ‘combinat’

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

combn

Monte Carlo Approximation (with 5000 Iterations) used:

Number of blocks: n=22
Number of treatments: k=3
For the given alpha=0.01, the upper cutoff value is Friedman, Kendall-Babington Smith S=9.9090909091, with true alpha level=0.01

Asymptotic Approximation used:

Number of blocks: n=22
Number of treatments: k=3
For the given alpha=0.01, the approximate upper cutoff value is Friedman, Kendall-Babington Smith S=9.21034037197618,
```

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