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:

CalfWeek
0102030405060708091011121314151617
675  XXXX       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 -  ( 22427 + 1)  = 3.524
51
22427(22427−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

Time (hours) from
treatment to lambing
Control (C) Treated (T)
45
87
123
120
70
 
51
71
42
37
51
78
51
49
56
47
58
 
= 89.0 = 53.7

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.

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
37
T
42
T
45
C
47
T
49
T
51
T
51
T
51
T
56
T
58
T
70
C
71
T
78
T
87
C
120
C
123
C

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.