R: Computes a critical value for the Lepage D distribution.
cLepage
R Documentation
Computes a critical value for the Lepage D distribution.
Description
This function computes the critical value for the Lepage D distriburion at (or typically in the "Exact" and "Monte Carlo" cases, close to) the given alpha level.
Usage
cLepage(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", "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 "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" or "Monte Carlo")
Author(s)
Grant Schneider
Examples
##Hollander-Wolfe-Chicken Example 5.3 Platelet Counts of Newborn Infants
cLepage(0.02,10,6,"Exact")
cLepage(0.02,10,6,"Monte Carlo")
cLepage(0.02,10,6,"Asymptotic")
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/cLepage.Rd_%03d_medium.png", width=480, height=480)
> ### Name: cLepage
> ### Title: Computes a critical value for the Lepage D distribution.
> ### Aliases: cLepage
> ### Keywords: Lepage
>
> ### ** Examples
>
> ##Hollander-Wolfe-Chicken Example 5.3 Platelet Counts of Newborn Infants
> cLepage(0.02,10,6,"Exact")
Number of X values: 10 Number of Y values: 6
For the given alpha= 0.02 , the upper cutoff value is Lepage D = 6.902521 ,
with true alpha level= 0.02
> cLepage(0.02,10,6,"Monte Carlo")
Monte Carlo Approximation (with 10000 Iterations) used:
Number of X values: 10 Number of Y values: 6
For the given alpha= 0.02 , the upper cutoff value is Lepage D = 6.868908 ,
with true alpha level= 0.0196
> cLepage(0.02,10,6,"Asymptotic")
Asymptotic Approximation used:
Number of X values: 10 Number of Y values: 6
For the given alpha= 0.02 , the approximate upper cutoff value is Lepage D = 7.824046 ,
>
>
>
>
>
> dev.off()
null device
1
>