Tukey
The Studentized Range Distribution

Description

Returns probability and quantile of the studentized range distribution.

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 numeric vectors in the studentized range that specify the quantiles.
p a numeric vector in the range [0, 1] that specifies the probabilities.
nmeans the number of treatments. Inf is accepted but produced NaNs.
df an integer, the error degrees of freedom. Inf is accepted.
nranges the number of groups.
lower.tail a logical scalar. If TRUE (default), probabilities are P[X <= x]. If FALSE, probabilities are P[X > x].
log.p a logical scalar. If FALSE (default), returns probabilities as p. If TRUE, returns probabilities as log(p).

Details

ptukey() computes the probability that the maximum of nranges studentized ranges, each based on nmeans means and with df degrees of freedom for the standard error, is less than q.
qtukey() computes the quantiles of the maximum of nranges studentized ranges, each based on nmeans means and with df degrees of freedom for the standard error.
The algorithm is based on that of the first reference.
Value
ptukey() returns probability of the studentized range distribution. qtukey() returns quantile of the studentized range distribution.
References
Copenhaver, M.D. and Holland, B. S. 1988. Multiple comparisons of simple effects in the two-way analysis of variance with fixed effects. Journal of Statistical Computation and Simulation. Volume 30. 1-15.
Hochberg, Y. and Tamhane, A. C. 1987. Multiple Comparison Procedures. New York, NY: Wiley.
Hsu, Jason C. 1996. Multiple Comparisons: Theory and Methods. London, UK: Chapman and Hall.
See Also
pnorm, qnorm
Examples
ptukey(c(6.5, 4.3, 3.2),  6, 200)
ptukey(c(6.5, 4.3, 3.2),  6, 200, log.p = TRUE)
ptukey(c(6.5, 4.3, 3.2),  6, 200, lower.tail = FALSE)

qtukey(0.95, 2, Inf)/sqrt(2) qtukey(0.99, 50, 100)

ptukey(qtukey(0.99, 50, 100) , 50, 100) # 0.99

Package stats version 6.0.0-69
Package Index