Q Test
Q Test
Sometimes you collect data by repeated measurements that seem to cluster around a certain value,
except for one odd data point. You want to be honest; you really did get that measurement, and
you don’t want to cheat. However, it does seem to be from another universe. For example, suppose
these are the readings from your experiment:
25.1 21.2 27.5 22.7 23.8 26.3 40.6 22.9
That 40.6 not only looks out of place, but it has an effect on the mean and standard deviation of
your data set:
mean standard deviation
including maximum value 26.1 6.3
excluding maximum value 24.0 2.1
It may also have an effect on statistical significance when you compare this distribution to another
one by a t-test.
Is it a mistake? Is it noise? Did your recording device hiccup? What is the likelihood of getting
an outlier this far from the next value when you are picking from a population with these
characteristics?
Chemists (and other scientists) often test for outliers with the Q-test. This test calculates the ratio
between the putative outlier’s distance from its nearest neighbor and the range of values:
Notice that as the distance between the potential outlier and its nearest neighbor increases, so does
Q.
potential outlier − nearest neighbor
Q=
maximum value − minimum value
The significance test consists of comparing your calculated Q to the theoretical Q that is expected
to occur 5% of the time if you were sampling from a population with this mean and standard
deviation. The € null hypothesis is that all your data points come from the same pool. If your Q is
as big as or bigger than the critical Q, then you can reject that null hypothesis with 95% confidence,
and safely exclude the one odd data point.
Table 1, on page 2, lists critical values of Q at the 5% significance level. Notice that the smaller
the number of data points, the larger Q must be for you to reject a data point. For a set of 8 data
points, according to the table, Q would be greater than 0.526 just by luck of the draw 5% of the
time or less. Since our experimental Q (0.675) is larger than 0.526, we may safely omit the 40.6
value from our data set, because such a large value is unlikely to occur by chance alone. We can
conclude that that data point measures something other than what all the others are measuring. To
maintain honesty, we can report something like this: “One very large (or small) value was rejected
from the data set by the Q-test with 95% confidence.”
You may only reject one data point from a data set by this method.
2 Q-Test for the Outlying Data Point
1
Table from David B. Rorabacher, 1991. Statistical treatment for rejection of deviant values: critical values of
Dixon's "Q" parameter and related subrange ratios at the 95% confidence level. Anal. Chem., 63 (2): 139–146
http://pubs.acs.org/doi/abs/10.1021/ac00002a010, accessed 9/10/09.