 InfluentialPoints.com
Biology, images, analysis, design...
 Use/Abuse Principles How To Related
"It has long been an axiom of mine that the little things are infinitely the most important" (Sherlock Holmes)

# Runs tests One-sample runs test & the Wald-Wolfowitz test  #### Worked example 1

Our first worked example is taken from the study by Pearce et al. (2004) on the pattern of shedding of five isolates of E. coli in a cohort beef calves. The table below gives the result for just one calf:

 Calf Week 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 675 X X X X X     In this example the number of runs (r) = 5, the number of non-shedding weeks (m) = 12 and the number of shedding weeks (n) = 5. Since both n and m are < 20 we cannot use the normal approximation. Using Siegel's tables the observed value (5) is not equal or smaller than the value in table FI (4). Hence the result is not significant (P > 0.05).

R does not have an exact runs test, but StatXact gives a two-sided permutation test P-value of 0.126 or a two-sided Monte Carlo P-value of 0.127. Note the one sided P-value (assuming an alternative hypothesis of clustering) is close to being significant at the conventional level (P = 0.063).

#### Worked example 2

We have a sample of pupae of an insect and we are interested whether males and female emerge in random order or whether the order of emergence is non-random.

 Order of emergence of males (M) and females (F) M M M M F M M M M M F M M M M M M F M M M M F M M M F F F F F F F M F F F F F F F M F F F F F F F F F

In this example r = 14, m = 24 and n = 27. Since both n and m are >20 we can use the normal approximation. So:

 z = 14 - ( 2×24×27 + 1) = 3.524 51 √ 2×24×27(2×24×27−51) 512 (51 − 1)

For a two-tailed test P = 0.0004, so we can conclude that the order of emergence is non-random. In this example we may well have decided in advance to carry out a one-tailed test - with the alternative hypothesis that emergence is clumped - given that regular alternation would not be biologically credible. In this case P = 0.0002. Using

#### Worked example 3

This example uses the same data on the effect of drug treatment on the length of time from treatment to lambing that we used in Unit 8 with the t-test. There we first used an equal-variance t-test on the log transformed data, having first checked for equality of variances with the F-ratio test. We obtained a P-value of 0.00986, which suggested that treatment was providing a significant reduction in lambing time. The unequal-variance t-test on the raw data gave a non-significant P-value of 0.0823, reflecting the erratic behaviour of the unequal variance t-test when sample sizes are very different.

 Time (hours) fromtreatment to lambing Control (C) Treated (T) 458712312070 517142375178 5149564758 = 89.0 = 53.7

Since we have two independent samples with skewed distributions we decide (admittedly rather unwisely) to use the Wald-Wolfowitz test. The ranked combined sample is shown below:

 Ranked combined sample 37T 42T 45C 47T 49T 51T 51T 51T 56T 58T 70C 71T 78T 87C 120C 123C

The number of runs (r) = 6, the number of control animals (m) = 5 and the number of treated animals (n) = 11. Since both n and m are < 20 we cannot use the normal approximation. Using Siegel's tables the observed value (6) is neither equal to nor smaller than the value in table F (4). Hence the result is not significant (P > 0.05).

One should note that even if the test result had been significant, interpretation would have been difficult. The interest in the trial was clearly to assess the effect of the drug on the 'average' lambing time, whether assessed by the median or the mean. The Wald-Wolfowitz test could only have indicated whether there was any difference between the distributions.

 Except where otherwise specified, all text and images on this page are copyright InfluentialPoints, all rights reserved. Images not copyright InfluentialPoints credit their source on web-pages attached via hypertext links from those images.