# nCDunnett: Noncentral Dunnett's test distribution

### Description

Computes the probability density, the cumulative distribution and the quantile functions and generates random samples for the noncentral Dunnett's test distribution with the numbers means equal to dimension of the vector rho that correspond to the correlation structure, the degrees of freedom equal to nu and the number of points of the Gauss-Legendre quadrature equal to n. The parameter of noncentrality is the vector delta, with the same dimension of rho. The two-sided test should be choosen with the two.sided option, where the default is true.

### Usage

 1 2 3 4 dNCDun(q, nu, rho, delta, n=32, two.sided = TRUE) pNCDun(q, nu, rho, delta, n=32, two.sided = TRUE) qNCDun(p, nu, rho, delta, n=32, two.sided = TRUE) rNCDun(N = 1, nu = Inf, rho, delta, two.sided=TRUE) 

### Arguments

 q vector of quantiles q \in R. p vector of probabilities (0, 1). rho vector of correlations, with length equal or greater than 1. N vector size to be simulated, with N > 1. nu degrees of freedom ν > 0. n number of points of the gaussian quadrature n > 2. delta vector of noncentrality parameter. Must be of the same length of rho. two.sided if true (default) the two-sided distribution is considered, else the one-sided distribution is considered.

### Details

Assumes n = 32 as default value for dNCDun, pNCDun and qNCDun. The nu can be a finite real number or an infinity real number. The default value of nu is Inf in rNCDun. When nu=1, the convergence of the routines requires n>200 points in the Gaussian quadrature to obtain the desired result accurately. The cumulative distribution function of the noncentral unilateral Dunnett's test statistic with finite degrees of freedom ν is

F(q; r, ν, \bm{ρ}, \bm{δ})= \displaystyle \int_0^∞ \int_{-∞}^∞ φ(y) ∏_{j=1}^r Φ≤ft(\frac{√{ρ_j} y + x q-δ_j}{√{1-ρ_j}}\right) f(x;ν)dy dx,

where \bm{ρ}=[ρ_1, ρ_2, …, ρ_r]^\top is the correlation vector, \bm{δ}=[δ_1, δ_2, …, δ_r]^\top is the vector of noncentrality parameter, q is the quantile of the noncentral unilateral Dunnett's test distribution, r is the numbers of means (or sample size) and ν is the degrees of freedom of a independent chi-square variable in the studentized process.The f(x;ν) probability density function is given by

f(x; ν)= \frac{ ν^{ν/2} }{Γ(ν/2)2^{ν/2-1}} x^{ν-1} e^{-ν x^2/2}, \quad x ≥ 0.

The cumulative distribution function of the noncentral unilateral Dunnett's test statistic with infinity degrees of freedom is

F(q; r, ν=∞, \bm{ρ}, \bm{δ})= \int_{-∞}^∞ φ(y) ∏_{j=1}^r Φ≤ft(\frac{√{ρ_j} y + q-δ_j }{√{1-ρ_j}}\right) dy.

The cumulative distribution function of the noncentral bilateral Dunnett's test statistic with finite degrees of freedom ν is

F(q; r, ν, \bm{ρ}, \bm{δ})= \int_0^∞ \int_{-∞}^∞ φ(y) ∏_{j=1}^r ≤ft[Φ≤ft(\frac{√{ρ_j} y + x q-δ_j}{√{1-ρ_j}}\right) - Φ≤ft(\frac{√{ρ_j} y - x q-δ_j}{√{1-ρ_j}}\right)\right] f(x;ν)dy dx.

Finally, the cumulative distribution function of the noncentral bilateral Dunnett's test statistic with infinity degrees of freedom is

F(q; r, ν=∞, \bm{ρ}, \bm{δ})= \int_{-∞}^∞ φ(y) ∏_{j=1}^r ≤ft[Φ≤ft(\frac{√{ρ_j} y + q -δ_j}{√{1-ρ_j}}\right) - Φ≤ft(\frac{√{ρ_j} y - q-δ_j }{√{1-ρ_j}}\right)\right] dy.

### Value

dNCDun gives the density, pNCDun gives the cumulative distribution function, qNCDun gives the quantile function, and rNCDun generates random deviates.

### Author(s)

Siomara Cristina Broch and Daniel Furtado Ferreira.

Maintainer: Daniel Furtado Ferreira <danielff@dex.ufla.br>

### References

Broch, SC; Ferreira, DF. The noncentral distribution of the Dunnett's statistics revisited. Submmited for publications. 2013.

Package homepage: <www.dex.ufla.br/~danielff/r_resources.html>

### Examples

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 library(nCDunnett) n <- 50 nu <- 9 rho <- c(0.5,0.5,0.5) delta <- c(0,0,0) x <- rNCDun(n, nu, rho, delta) hist(x) q <- 2.30 p <- 0.95 prob <- length(x[x<=q])/n prob pNCDun(q, nu, rho, delta, 32, TRUE) dNCDun(q, nu, rho, delta, 32, TRUE) qNCDun(p, nu, rho, delta, 16, TRUE) q <- c(2.34, 4.50, 3.40) p <- c(0.85, 0.95, 0.975) nu <- c(Inf, 19, 15) # unbalanced example rho <- c(0.23, 0.25, 0.27) delta <- c(0, 0, 0) # central case pNCDun(q, nu, rho, delta, 32, TRUE) dNCDun(q, nu, rho, delta, 32, TRUE) qNCDun(p, nu, rho, delta, 16, TRUE) 

Search within the nCDunnett package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.