Tukey {stats}R Documentation

The Studentized Range Distribution


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


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



vector of quantiles.


vector of probabilities.


sample size for range (same for each group).


degrees of freedom for s (see below).


number of groups whose maximum range is considered.


logical; if TRUE, probabilities p are given as log(p).


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


If ng =nranges is greater than one, R is the maximum of ng groups of nmeans observations each.


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.


A Legendre 16-point formula is used for the integral of ptukey. The computations are relatively expensive, especially for qtukey which uses a simple secant method for finding the inverse of ptukey. qtukey will be accurate to the 4th decimal place.


qtukey is in part adapted from Odeh and Evans (1974).


Copenhaver, Margaret Diponzio and Holland, Burt S. (1988). Computation of the distribution of the maximum studentized range statistic with application to multiple significance testing of simple effects. Journal of Statistical Computation and Simulation, 30, 1–15. doi: 10.1080/00949658808811082.

Odeh, R. E. and Evans, J. O. (1974). Algorithm AS 70: Percentage Points of the Normal Distribution. Applied Statistics, 23, 96–97. doi: 10.2307/2347061.

See Also

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


  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)))

[Package stats version 3.5.0 Index]