Studentized Range (Q) Distribution
Menu location: Analysis_Distributions_Studentized Range (Q).
The Studentized range, Q, is a statistic due to Newman (1939) and Keuls (1952) that is used in multiple comparison methods. Q is defined as the range of means divided by the estimated standard error of the mean for a set of samples being compared. The estimated standard error of the mean for a group of samples is usually derived from analysis of variance.
Technical Validation
StatsDirect calculates tail areas and percentage points for a given number of samples and sample sizes (Copenhaver and Holland, 1988). These calculations are highly iterative therefore you may notice a delay during their computation. Other software and web sites might produce different results to StatsDirect; this is likely to be due to their use of less precise or more restricted algorithms (Gleason, 1999; Lund and Lund, 1983; Royston, 1987).
Example
Consider the multiple comparisons example, in which four groups of ten observations are compared after a one way analysis of variance with 36 residual degrees of freedom. The Tukey table gives the Studentized range statistic q = 3.74767 for the contrast between Substance 1 and Substance 2, with P = 0.0552, and a critical value of 3.808798 at the 5% level.
To evaluate this in StatsDirect select Studentized Range (Q) from the Distributions section of the Analysis menu. Enter 3.74767 as the Studentized range Q, 36 as the degrees of freedom and 4 as the number of samples, then click Calculate. To find the Q for a given upper tail P instead, enter the P in the upper tail box, the degrees of freedom and the number of samples and click Invert. The results are shown to seven decimal places and are written to the report as probability distribution calculations.
For this example:
P(Q 3.74767, df 36, samples 4) = 0.0551754 upper, 0.9448246 lower
This upper tail P, 0.0552 to four decimal places, is the Tukey P for the contrast. Inverting for an upper tail P of 0.05 with the same degrees of freedom and number of samples gives the 5% critical value of Q that the Tukey table shows:
Q(upper P 0.05, df 36, samples 4) = 3.8087984
With two samples the range of the two means is their difference, so Q is √2 times Student's t. Inverting for an upper tail P of 0.05 with 36 degrees of freedom and 2 samples gives:
Q(upper P 0.05, df 36, samples 2) = 2.868158
which is √2 times 2.028094, the two sided 5% point of Student's t with 36 degrees of freedom. These figures were computed in R (ptukey and qtukey) and agree with the values StatsDirect gives, to the precision shown.
R code
This R code reproduces the example above. It needs no packages and was checked with R 4.6.1. Paste it into R, or save it as a script and run it.
# Studentized range (Q) distribution: the StatsDirect help illustration (the Tukey P
# and the 5% critical value from the multiple comparisons example, and the link with
# Student's t when there are two samples) in R
# The dialog shows its results to 7 decimal places, so these do too
seven <- function(x) formatC(x, digits = 7, format = "f", drop0trailing = TRUE)
# 1. Tail probabilities of Q = 3.74767 for 4 samples (means) with 36 residual degrees
# of freedom (the Tukey contrast between Substance 1 and Substance 2): ptukey() gives
# the lower tail unless told otherwise
q <- 3.74767
k <- 4
df <- 36
upper <- ptukey(q, nmeans = k, df = df, lower.tail = FALSE)
lower <- ptukey(q, nmeans = k, df = df)
cat("P(Q 3.74767, df 36, samples 4) =", seven(upper), "upper, ", seven(lower),
"lower\n")
# 2. The inverse: the Q with 5% in its upper tail (the 5% critical value) for 4
# samples with 36 degrees of freedom. qtukey() is documented as accurate to the 4th
# decimal place, so its value is refined to the 7 places shown by solving
# ptukey() = 0.95
crit <- qtukey(0.95, nmeans = k, df = df)
crit <- uniroot(function(x) ptukey(x, nmeans = k, df = df) - 0.95,
c(crit - 0.05, crit + 0.05), tol = 1e-10)$root
cat("Q(upper P 0.05, df 36, samples 4) =", seven(crit), "\n")
# 3. With two samples the range of the means is their difference, so Q is root 2
# times |t|: the 5% point of Q for 2 samples with 36 degrees of freedom is root 2 times
# the two sided 5% point of Student's t on 36 degrees of freedom (2.5% in each tail)
crit2 <- qtukey(0.95, nmeans = 2, df = df)
crit2 <- uniroot(function(x) ptukey(x, nmeans = 2, df = df) - 0.95,
c(crit2 - 0.05, crit2 + 0.05), tol = 1e-10)$root
t <- qt(0.975, df = df)
cat("Q(upper P 0.05, df 36, samples 2) =", seven(crit2), "\n")
cat("Student's t (two sided 5% point, df 36) =", seven(t), " times root 2 =",
seven(sqrt(2) * t), "\n")