Learn R Programming

PMCMRplus (version 1.9.12)

qDunnett: Dunnett Distribution

Description

Distribution function and quantile function for the distribution of Dunnett's many-to-one comparisons test.

Usage

qDunnett(p, n0, n)

pDunnett(q, n0, n, lower.tail = TRUE)

Value

pDunnett gives the distribution function and qDunnett gives its inverse, the quantile function.

Arguments

p

vector of probabilities.

n0

sample size for control group.

n

vector of sample sizes for treatment groups.

q

vector of quantiles.

lower.tail

logical; if TRUE (default), probabilities are \(P[X \leq x]\) otherwise, \(P[X > x]\).

Details

Dunnett's distribution is a special case of the multivariate t distribution.

Let the total sample size be \(N = n_0 + \sum_i^m n_i\), with \(m\) the number of treatment groups, than the quantile \(T_{m v \rho \alpha}\) is calculated with \(v = N - k\) degree of freedom and the correlation \(\rho\)

$$ \rho_{ij} = \sqrt{\frac{n_i n_j} {\left(n_i + n_0\right) \left(n_j+ n_0\right)}} ~~ (i \ne j). $$

The functions determines \(m\) via the length of the input vector n.

Quantiles and p-values are computed with the functions of the package mvtnorm.

See Also

qmvt pmvt dunnettTest

Examples

Run this code
## Table gives 2.34 for df = 6, m = 2, one-sided
set.seed(112)
qval <- qDunnett(p = 0.05, n0 = 3, n = rep(3,2))
round(qval, 2)
set.seed(112)
pDunnett(qval, n0=3, n = rep(3,2), lower.tail = FALSE)

## Table gives 2.65 for df = 20, m = 4, two-sided
set.seed(112)
qval <- qDunnett(p = 0.05/2, n0 = 5, n = rep(5,4))
round(qval, 2)
set.seed(112)
2 * pDunnett(qval, n0= 5, n = rep(5,4), lower.tail= FALSE)

Run the code above in your browser using DataLab