Past exam of the mathematics course of the University of Cambridge 2001 iii Paper 32 5 ii Solution Created 2026-10-03 Updated 2026-10-14
Use the usual two mutually independent samples, and rank their pooled observations increasingly. Continuity gives no ties with probability one. Let be the pooled rank of and define the Wilcoxon rank sum test statisticThe last identity counts the ranks contributed by the other sample after subtracting the within- ranks.
When , the observations are stochastically smaller, so reject for small , equivalently small . For instance,The inequality follows from and for continuous . A common-uniform quantile coupling also makes this direction transparent: , and is nondecreasing in each .
Under the common-distribution null hypothesis, the pooled observations are exchangeable. Every selection of ranks for the labels has probability . Thus the exact null law isChoose a lower-tail critical value with probability at most the desired size, optionally randomizing at its boundary to attain the size exactly. This law is independent of the unknown common distribution. Common increasing transformations leave the pooled ranks of observations unchanged, so the statistic is a function of the maximal invariant from part (i). Although a rank sum is not itself maximal, it is an invariant test statistic. These facts justify the test within nonparametric statistics.
Sampling ranks without replacement givesso with the same variance. For with , the normal approximation for a rank sum statesEquivalently replace by . The large-sample one-sided test rejects when this standardized statistic is below the lower normal distribution quantile. This is the two-sample rank-sum test, rather than the paired Wilcoxon signed-rank test.
Past exam of the mathematics course of the University of Cambridge 2009 iii Paper 38 4 Solution Created 2026-10-03 Updated 2026-10-14
For the one-sided Wilcoxon rank sum test, suppose and are independent samples, iid within each sample, with continuous distributions. The null hypothesis is a common distribution. For a lower-tail alternative, the distribution is stochastically smaller. In the common-shape location model , this is against ; in that model it also compares medians. Without a location-family assumption, equality or inequality of medians alone is not the defining rank-sum hypothesis.
Rank all observations from smallest to largest and form . Reject for small . Under , the labels are exchangeable, so every subset of of the ranks is equally probable. The exact null distribution of a rank sum is thereforeEnumerate these subsets, or use the coefficient of in . An efficient recursion adds rank either to the selected sample or not: , starting with . The lower-tail P-value is . A nonrandomized level- test chooses a lower-tail rejection region whose null probability is at most .
The shifted Mann–Whitney U test statistic is . It counts pairs with , so the same lower-tail test uses small . The distinction is important for these S-Plus outputs: the printed values are raw rank sums, not the shifted statistic used by some other software.
For the one-sided Wilcoxon signed-rank test, the pairs are independent between individuals but their two measurements may be dependent. Let , and assume the differences are iid, continuous and symmetric about a common location . Test against . Rank the absolute differences and useUnder the null, conditional on their absolute values, the signs are independent fair signs. Every subset of ranks therefore has probability of being the positive-sign subset, giving the exact null distribution of . Reject for small and calculate the lower-tail probability. Its null mean and variance are and . The symmetry assumption is essential: zero median by itself does not give this law. With zeros or ties, omit zero differences in the usual signed-rank version and use average ranks for ties, adjusting the distribution accordingly. The paired test is not appropriate for the independent RHR samples here.
For the experienced participants, let denote RHR1 running time and denote RHR2 running time. The null hypothesis is identical running-time distributions; under the location interpretation it is zero RHR1-minus-RHR2 shift. The one-sided alternative is a negative shift, so RHR1 participants tend to run faster. With , the printed statistic isAt , reject the null in favour of faster RHR1 running times. The sample medians and minutes agree with that direction; their difference is descriptive, not the rank-sum test statistic.
For the new participants the same independent-sample Wilcoxon rank sum test compares eight RHR1 times against nine RHR2 times, again with a lower-tail alternative. HereThe exact null distribution of a rank sum gives this probability. It does not reject at , although it is just below . The data suggest the same direction but are less decisive; this is not evidence that the two new-participant distributions are equal.
The final command pools the experienced and new RHR1 samples into observations, and the corresponding RHR2 samples into . It repeats the lower-tail rank-sum comparison on these two pooled groups.
exact=F requests a normal approximation for a rank sum with a continuity correction. Without ties,The lower-tail statistic is , with the usual tie-adjusted variance if ties occur. The supplied output iswhere is the standard normal distribution function. Thus the pooled test rejects at . The unreported pooled ranks must be formed afresh: the within-cohort raw rank sums cannot simply be added because pooling introduces cross-cohort comparisons.Taken together, there is evidence that participants classified as RHR1 have shorter running times among the experienced men and in the pooled sample. The smaller new-participant samples give weaker evidence in the same direction. A significant result in one cohort and a nonsignificant result in another does not itself prove that their RHR effects differ. Pooling also assumes a meaningful pooled comparison; if programme duration changes the distributions, a cohort-adjusted analysis would be more informative. These observational comparisons do not establish that the fitness programme caused the differences, and none of the three tests directly compares experienced participants with new participants.