2.6 Quartile Test

The sign test of the previous chapter tests a hypothesis about the population median. Nothing in its construction is special to the median, and the same argument tests any quantile: the leading case, and the one this section is named for, is a quartile.

The general situation is this. The value below which one quarter of the population lies is the lower quartile; the value below which three quarters lie is the upper quartile. More finely, a value such that \(r\) tenths of the observations fall below it and \(10-r\) tenths above, \(r=1,2,\dots ,9\), is the \(r^{th}\) decile, the fifth decile being the median. To test \(H_0:Q(P)=q_0\) for any fraction \(P\), count how many observations fall below \(q_0\). Under \(H_0\) each observation independently falls below \(q_0\) with probability \(P\), so that count is \[B\sim \operatorname {Bin}(n,P),\] and the sign test is exactly the case \(P=0.5\). Many tests and estimation procedures involving quantiles proceed along these lines, replacing \(P=0.5\) by the fraction of interest.

For a continuous distribution quantiles are unique and no ties arise. For a discrete distribution a convention is needed, and the usual one for a sample of even size \(2m\) is to order the observations, write \(X_{(r)}\) for the \(r^{th}\), and define the median as \[\dfrac {X_{(m)}+X_{(m+1)}}{2}.\]

Example 2.26. A central examination body reports that three quarters of all candidates taking mathematics achieve \(40\) marks or more, so that \(40\) is the national lower quartile. At one school, \(32\) candidates sat the paper and \(13\) scored below \(40\). The chair of the PTA says the school is performing below the national standard. The head master replies that in a random sample of \(32\) candidates about \(8\) would be expected to fall below the lower quartile, and \(13\) is within reach of \(8\). Is the head master’s claim justified?

Hypotheses. Writing \(Q_1\) for the school’s lower quartile, \[H_0:Q_1=40\hspace {0.6cm}\text {vs}\hspace {0.6cm}H_a:Q_1\neq 40 .\]

Statistic. Associate a minus with a mark below \(40\). The data give \(13\) minuses and \(19\) pluses. If the school’s lower quartile really is \(40\) then each candidate scores below \(40\) with probability \(P=0.25\), so the number of minuses is \[B\sim \operatorname {Bin}\left (32,\tfrac {1}{4}\right ),\hspace {0.8cm}E(B)=32\times 0.25=8 .\]

\(p\)-value. The observed \(13\) exceeds the expected \(8\), so the upper tail is the relevant one: \[P(B\geq 13)=\sum ^{32}_{b=13}\binom {32}{b}(0.25)^{b}(0.75)^{32-b}=0.0378 ,\] and for the two-sided alternative \(p=2\times 0.0378=0.0755\).

Decision. Since \(0.0755>0.05\) we do not reject \(H_0\) at the \(5\%\) level. The evidence is not strong enough to say the school’s lower quartile differs from \(40\), and to that extent the head master’s claim is justified.

Note 2.27. This example is worth a second look, because the one-sided and two-sided tests disagree. The one-sided \(p\)-value is \(0.0378\), which is below \(0.05\); the two-sided is \(0.0755\), which is above. Had the alternative been \(H_a:Q_1<40\) — the PTA chair’s claim, that the school is worse than the national standard — the same data would have led to rejection.

Which is right depends entirely on what was decided before the marks were seen. If the concern was always that the school might be underperforming, the one-sided test is legitimate and the school has a case to answer. If the question was open, the two-sided test is the honest one and the verdict is no evidence either way. Choosing the side after seeing which tail the data fell in doubles the true error rate while appearing to leave it at \(5\%\), and is one of the commonest abuses of significance testing. Fix the alternative first.

Questions on this section

Stuck on something here? Ask below and it stays attached to this topic.