Learn R Programming

stats (version 3.3.2)

Tukey: The Studentized Range Distribution

Description

Functions of the distribution of the studentized range, \(R/s\), where \(R\) is the range of a standard normal sample and \(df \times s^2\) is independently distributed as chi-squared with \(df\) degrees of freedom, see pchisq.

Usage

ptukey(q, nmeans, df, nranges = 1, lower.tail = TRUE, log.p = FALSE)
qtukey(p, nmeans, df, nranges = 1, lower.tail = TRUE, log.p = FALSE)

Arguments

q
vector of quantiles.
p
vector of probabilities.
nmeans
sample size for range (same for each group).
df
degrees of freedom for \(s\) (see below).
nranges
number of groups whose maximum range is considered.
log.p
logical; if TRUE, probabilities p are given as log(p).
lower.tail
logical; if TRUE (default), probabilities are \(P[X \le x]\), otherwise, \(P[X > x]\).

Value

ptukey gives the distribution function and qtukey its inverse, the quantile function. The length of the result is the maximum of the lengths of the numerical arguments. The other numerical arguments are recycled to that length. Only the first elements of the logical arguments are used.

Details

If \(n_g =\)nranges is greater than one, \(R\) is the maximum of \(n_g\) groups of nmeans observations each.

References

Copenhaver, Margaret Diponzio and Holland, Burt S. (1988) Multiple comparisons of simple effects in the two-way analysis of variance with fixed effects. Journal of Statistical Computation and Simulation, 30, 1--15. Odeh, R. E. and Evans, J. O. (1974) Algorithm AS 70: Percentage Points of the Normal Distribution. Applied Statistics 23, 96--97.

See Also

Distributions for standard distributions, including pnorm and qnorm for the corresponding functions for the normal distribution.

Examples

Run this code
if(interactive())
  curve(ptukey(x, nm = 6, df = 5), from = -1, to = 8, n = 101)
(ptt <- ptukey(0:10, 2, df =  5))
(qtt <- qtukey(.95, 2, df =  2:11))
## The precision may be not much more than about 8 digits:
summary(abs(.95 - ptukey(qtt, 2, df = 2:11)))

Run the code above in your browser using DataLab