R: Computes a critical value for the Jonckheere-Terpstra J...
cJCK
R Documentation
Computes a critical value for the Jonckheere-Terpstra J distribution.
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
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")
Author(s)
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
##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")
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(NSM3)
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
fANCOVA 0.5-1 loaded
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/NSM3/cJCK.Rd_%03d_medium.png", width=480, height=480)
> ### Name: cJCK
> ### Title: Computes a critical value for the Jonckheere-Terpstra J
> ### distribution.
> ### Aliases: cJCK
> ### Keywords: Jonckheere-Terpstra
>
> ### ** Examples
>
> ##Hollander-Wolfe-Chicken Example 6.2 Motivational Effect of Knowledge of Performance
> cJCK(.0490, c(6,6,6),"Exact")
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
> cJCK(.0490, c(6,6,6),"Monte Carlo")
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.
> cJCK(.0231, c(6,6,6),"Exact")
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
>
>
>
>
>
> dev.off()
null device
1
>