The University of Sydney · FACULTY OF STATISTICS

DATA2002 Chap.8 Rank-based tests when normality fails

- one subject, every graph, every model, every mark
12 Chapters6-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 8 of 16 · DATA2002

Rank-based tests when normality fails

Everything in the previous two chapters assumed the measurements came from a normal population. On a large sample that assumption is nearly free; on a dozen observations it is doing real work, and if it fails the p-value is not approximately right, it is unfounded. This chapter is about what to do instead, and the answer is counter-intuitive: deliberately discard part of the data. Three procedures form a ladder.

The t test uses the value of every observation and is the most powerful when its assumptions hold. The signed rank test keeps the ordering of the magnitudes and the signs, so an extreme observation becomes merely the largest rank and cannot dominate. The sign test keeps only the direction of each difference and is unmoved by any magnitude at all.

Each step down the ladder loses information and gains immunity, and the trade is the point of the chapter rather than a footnote to it.

The sign test is a binomial test in disguise: if the differences are symmetric about the hypothesised value then each is equally likely to fall above or below, so the count of positives behaves like the number of heads in fair coin tosses, and the hypothesis about a mean becomes a hypothesis about a proportion of one half. It has no degrees of freedom, and its sample size counts only the non zero differences.

The signed rank test recovers the magnitude ordering by ranking absolute differences and summing the ranks belonging to positive ones, with an identity that lets you check the ranking in one line. For two independent samples the rank sum test pools both samples, ranks them together and sums over one of them, which removes every unit of measurement from the problem.

None of the three has degrees of freedom, and each reports a statistic that software may print in a different form from the one you computed.

In this chapter

What this chapter covers

  • 01

    Checking normality graphically, and why a histogram is unreliable at these sample sizes

  • 02

    The distribution free assumptions the three rank procedures actually need

  • 03

    The sign test as a binomial test on directions, with no degrees of freedom

  • 04

    Why zero differences are discarded, and how that changes the sample size

  • 05

    The four p-value branches, and doubling the tail the observation is actually in

  • 06

    The signed rank construction: rank the absolute differences, sum the positive ranks

  • 07

    The identity that the two rank sums add to a fixed total, as an arithmetic check

  • 08

    Expected value and variance of the positive rank sum, and the no ties condition on the variance

  • 09

    Ties, average ranks, and why the exact distribution is then treated as unknown

  • 10

    The rank sum test: pool, rank together, sum over one sample

  • 11

    Its expected value derived as a proportion of the total rank sum

  • 12

    Why the printed statistic differs from the hand computed one in both rank tests

Worked example · free

Count the sample size and check a ranking

Q [4 marks]. Nine paired differences are recorded: 2.4, minus 0.6, 1.9, 0.0, 3.1, 1.2, minus 0.4, 2.8, 1.5. State the sample size the sign test would use and its statistic, then state the sample size the signed rank test would use and the total the two rank sums must reach. (4 marks. The mark allocation is ours, not the University's.)
  • +1.5The zero difference is discarded by both procedures, because it is neither above nor below the hypothesised value. So the sample size is eight in each case, not nine.
  • +1The sign statistic is the number of positive differences among the remaining eight, which is six.
  • +1For the signed rank test the eight absolute differences are ranked one to eight, so the two rank sums must add to eight times nine over two, which is thirty six.
  • +0.5Reporting that total is the fastest check on the ranking: if the positive and negative rank sums do not add to thirty six, the ranks were assigned wrongly and nothing computed from them can be trusted.
Eight in both cases; a sign statistic of six; and a rank sum total of thirty six that the two partial sums must reach.
Sia tip — Discarding zeros before counting is the step most often skipped, and it changes both the sample size and the null distribution. Do it first, then count, then rank.
Glossary

Key terms

Distribution free
Describing a procedure whose null distribution does not depend on the shape of the population. It is not the same as assumption free, since independence and often symmetry are still required.
Sign test
A test of whether differences are centred at a hypothesised value, using only whether each difference is above or below it. Under the null the count of positives follows a binomial distribution with probability one half.
Signed rank test
A test that ranks the absolute differences and sums the ranks belonging to the positive ones, so that magnitude ordering is used while actual magnitudes are not.
Rank sum test
A test for two independent samples that ranks the combined sample and sums the ranks belonging to one of them. It also travels under two other names in the literature.
Positive rank sum
The total of the ranks assigned to positive differences. Its expectation and variance under the null have closed forms when there are no ties.
Ties
Equal values receiving the same average rank. Their presence changes the variance and means the exact null distribution is treated as unknown, so software moves to a normal approximation.
Zero difference
A difference exactly equal to the hypothesised value. It is discarded before the count or the ranking, which reduces the sample size used by the test.
Normal approximation
Using a normal distribution for a rank statistic once the sample is large enough or ties make the exact distribution unavailable. It requires the expectation and variance of the statistic.
Symmetry assumption
The requirement that the distribution of differences is symmetric about the hypothesised value, which is what licenses the signed rank test and lets its hypothesis be stated about the median.
Location shift
The model under which two distributions have the same shape and differ only by a constant, which is what the rank sum test is testing for.
FAQ

Rank-based tests when normality fails FAQ

If rank tests need fewer assumptions, why not always use them?

Because when the normality assumption really holds, the t test is more powerful and the rank tests will miss effects it would find. Discarding information buys immunity and costs sensitivity, and paying that cost when nothing is wrong is a waste of real data.

The choice should be made from the diagnostic plot and the design before any p-value is seen, which is the one part of the decision that is not negotiable: running all three and reporting the most favourable is the genuinely indefensible move.

Why do the three tests sometimes disagree on the same data?

Because they see different amounts of the data. A single extreme observation moves the sample mean and inflates the sample standard deviation, damaging both the numerator and the denominator of a t statistic. To the signed rank test that observation is only the largest rank, worth a bounded amount however extreme it becomes, and to the sign test it is one direction among many.

A disagreement is therefore informative: it says the answer is being driven by a small number of extreme observations, and the right response is to look at them rather than to pick a winner.

Do rank tests have degrees of freedom?

No, and writing degrees of freedom beside one of them is a definition error. Their null distributions are indexed by the sample size, and for the rank sum test by both sample sizes, together with the pattern of ties where there is one. That is a different kind of parameter from the degrees of freedom of a t or chi-squared distribution, and questions do test whether you know the difference.

Why does the printed statistic not match the one I computed?

Because software and hand calculation use different summaries of the same ranking. For the paired test, hand calculation usually reports the smaller of the two rank sums while output reports the positive rank sum itself. For the two sample test, output commonly reports the rank sum minus the smallest value it could possibly take, so that the distribution starts at zero.

Both conventions give the same p-value, and comparing a printed statistic with a hand computed one without checking which convention each uses is how the confusion starts.

How should I check normality in the first place?

Graphically, and on the right object. Plot the values against the quantiles a normal sample of that size would produce and look for systematic curvature or a point far off the line. For a paired design plot the differences rather than the two columns, since it is the differences the test assumes are normal.

Perfection is not the standard: a dozen observations from a genuinely normal population routinely look lumpy, and what matters most is the tails, because that is where the critical values live.

Study strategy

Exam move

Hold the ladder in mind as one picture: how much of the data each procedure uses, and what that buys and what it costs. Once that is clear the individual procedures are short, and what remains is three mechanical moves, which is where the marks actually leak. Discard zeros and reduce the sample size before anything else happens.

Rank absolute differences rather than differences, then check the ranking against the fixed total the two rank sums must reach. For the two sample test, rank the pooled sample and only then separate it again, because ranking within each sample separately is a different and wrong procedure.

With those three automatic, spend the remaining time on selection rather than on arithmetic: given a scenario, is it paired or independent, is a symmetry assumption defensible, and are there ties.

Close by writing one comparison of your own in which the same dataset is run through a t test and a rank test and the answers differ, together with the sentence you would put in a report to explain it, because that sentence carries a mark that neither p-value on its own can earn.

Working through Rank-based tests when normality fails in DATA2002? Sia is AskSia’s AI Statistics tutor — ask any DATA2002 Rank-based tests when normality fails question and get a clear, step-by-step explanation grounded in how DATA2002 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.

A+Everything unlocked
Unlocks this Bible + all 64 of your The University of Sydney subjects - and 1,000+ Bibles across every Australian university.
Sia - your DATA2002 tutor, unlimited, worked the way the exam marks it
The full 6-page Bible + practice bank with worked solutions
Chrome extension - sync your LMS so Sia knows your deadlines
Bilingual EN / Chinese on every Bible and every Sia answer
$0.99 Trial
30-day money-back · cancel in one tap · how it works
Unlock the full DATA2002 Bible + 64 The University of Sydney subjects
$0.99 Trial