The sign test is a primitive test which can be applied when the conditions for the single sample t-test are not met. The test itself is very simple: perform a binomial test (or use the normal distribution approximation when the sample is sufficiently large) on the signs as indicated in the following example.
Example 1: A company claims that they offer a therapy to reduce memory loss for senile patients. To test this claim they take a sample of 15 patients and test each patient’s percentage of memory loss, with the results given in Figure 1 (range A3:B18). Determine whether the therapy is effective compared with the expected median memory loss over the same period of time of 20%.
Figure 1 – Sign test for Example 1
As can be seen from the histogram and QQ plot, the data is not normally distributed and so we decide not to use the usual parametric tests (t-test). Instead we use the sign test with the null hypothesis:
H0: population median ≥ 20
To perform the test we count the number of data elements > 20 and the number of data elements < 20. We drop the data elements with value exactly 20 from the sample. In column C of Figure 1 we put a +1 if the data element is > 20, a -1 if the data element is < 20 and 0 if the data element is = 20.
The number N+ of data elements > 20 (cell B21) is given by the formula =COUNTIF(C4:C18,1). Similarly, the number N- of data elements < 20 (cell B22) is given by the formula =COUNTIF(C4:C18,-1). The revised sample size (cell 23) is given by the formula =B21+B22.
If the null hypothesis is true then the probability that a data element is > 20 is .5, and so we need to test the probability that actually 4 out of 14 data elements are less than the median given that the probability on any trial is .5, i.e.
p-value = BINOMDIST(4, 14, .5, TRUE) = .0898 > .05 = α
Since the p-value > α, (one-tailed test) we can’t reject the null hypothesis, and so cannot conclude with 95% confidence that the median amount of memory loss using the therapy is less than the usual 20% median memory loss.
Note that we have used a one-tail test. If we had used a two-tail test instead then we would have to double the p-value calculated above. Also note that in performing a two-tail test you should perform the test using the smaller of N+ and N-, which for this example is N+ = 4 (since N- = 10 is larger).
Real Statistics Excel Function: The Real Statistics Pack provides the following function:
SignTest(R1, med, tails) = the p-value for the sign test where R1 contains the sample data, med = the hypothesized median and tails = the # of tails: 1 (default) or 2.
This function ignores any empty or non-numeric cells.
Observation: Generally Wilcoxon’s signed-ranks test will be used instead of the simple sign test when the conditions for the t-test are not met since it will give better results since not just the signs but also the ranking of the data are taken into account.