cAnsBrad: Function to compute a critical value for the Ansari-Bradley C...

View source: R/cAnsBrad.R

cAnsBradR Documentation

Function to compute a critical value for the Ansari-Bradley C distribution.

Description

This function uses pAnsari and qAnsari from the base stats package to compute the critical value for the Ansari-Bradley C distribution at (or typically in the "Exact" case, close to) the given alpha level. The program is reasonably quick for large data, well after the asymptotic approximation suffices, so Monte Carlo methods are not included.

Usage

cAnsBrad(alpha, m, n, method = NA, n.mc = 10000)

Arguments

alpha

A numeric value between 0 and 1.

m

A numeric value indicating the size of the first data group (X).

n

A numeric value indicating the size of the second data group (Y).

method

Either "Exact" or "Asymptotic", indicating the desired distribution. When method=NA, if m+n<=200, the "Exact" method will be used to compute the C 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 "NSM3Ch5c" class containing the following components:

m

number of observations in the first data group (X)

n

number of observations in the second data group (Y)

cutoff.U

upper tail cutoff at or below user-specified alpha

true.alpha.U

true alpha level corresponding to cutoff.U (if method="Exact")

cutoff.L

lower tail cutoff at or below user-specified alpha

true.alpha.L

true alpha level corresponding to cutoff.L (if method="Exact")

Author(s)

Grant Schneider

References

This function uses the source code ansari.c from the stats package by: R Core Team (2013). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. URL http://www.R-project.org/.

See Also

Also see ansari.test()

Examples

##Hollander, Wolfe, Chicken - NSM3 - Example 5.1 (Serum Iron Determination):
cAnsBrad(0.05,20,20,"Asymptotic")
cAnsBrad(0.05,20,20,"Exact")

##Bigger data
cAnsBrad(0.05,100,100,"Exact")

NSM3 documentation built on Nov. 4, 2024, 5:08 p.m.

Related to cAnsBrad in NSM3...