nCDunnett (version 1.1.0)

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

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 $\nu > 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.

Value

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

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 $\nu$ is $$F(q; r, \nu, \bm{\rho}, \bm{\delta})= \displaystyle \int_0^\infty \int_{-\infty}^\infty \phi(y) \prod_{j=1}^r \Phi\left(\frac{\sqrt{\rho_j} y + x q-\delta_j}{\sqrt{1-\rho_j}}\right) f(x;\nu)dy dx,$$ where $\bm{\rho}=[\rho_1, \rho_2, \ldots, \rho_r]^\top$ is the correlation vector, $\bm{\delta}=[\delta_1, \delta_2, \ldots, \delta_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 $\nu$ is the degrees of freedom of a independent chi-square variable in the studentized process.The $f(x;\nu)$ probability density function is given by $$f(x; \nu)= \frac{ \nu^{\nu/2} }{\Gamma(\nu/2)2^{\nu/2-1}} x^{\nu-1} e^{-\nu x^2/2}, \quad x \ge 0.$$ The cumulative distribution function of the noncentral unilateral Dunnett's test statistic with infinity degrees of freedom is $$F(q; r, \nu=\infty, \bm{\rho}, \bm{\delta})= \int_{-\infty}^\infty \phi(y) \prod_{j=1}^r \Phi\left(\frac{\sqrt{\rho_j} y + q-\delta_j }{\sqrt{1-\rho_j}}\right) dy.$$ The cumulative distribution function of the noncentral bilateral Dunnett's test statistic with finite degrees of freedom $\nu$ is $$F(q; r, \nu, \bm{\rho}, \bm{\delta})= \int_0^\infty \int_{-\infty}^\infty \phi(y) \prod_{j=1}^r \left[\Phi\left(\frac{\sqrt{\rho_j} y + x q-\delta_j}{\sqrt{1-\rho_j}}\right) - \Phi\left(\frac{\sqrt{\rho_j} y - x q-\delta_j}{\sqrt{1-\rho_j}}\right)\right] f(x;\nu)dy dx.$$ Finally, the cumulative distribution function of the noncentral bilateral Dunnett's test statistic with infinity degrees of freedom is $$F(q; r, \nu=\infty, \bm{\rho}, \bm{\delta})= \int_{-\infty}^\infty \phi(y) \prod_{j=1}^r \left[\Phi\left(\frac{\sqrt{\rho_j} y + q -\delta_j}{\sqrt{1-\rho_j}}\right) - \Phi\left(\frac{\sqrt{\rho_j} y - q-\delta_j }{\sqrt{1-\rho_j}}\right)\right] dy.$$

References

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

See Also

Package homepage:

Examples

Run this code
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)

Run the code above in your browser using DataLab