Sign test
This page offers all the basic information you need about the sign test. It is part of Statkat’s wiki module, containing similarly structured info pages for many different statistical methods. The info pages give information about null and alternative hypotheses, assumptions, test statistics and confidence intervals, how to find p values, SPSS how-to’s and more.
To compare the sign test with other statistical methods, go to Statkat's or practice with the sign test at Statkat's
Contents
- 1. When to use
- 2. Null hypothesis
- 3. Alternative hypothesis
- 4. Assumptions
- 5. Test statistic
- 6. Sampling distribution
- 7. Significant?
- 8. Equivalent to
- 9. Example context
- 10. SPSS
- 11. Jamovi
When to use?
Deciding which statistical method to use to analyze your data can be a challenging task. Whether a statistical method is appropriate for your data is partly determined by the measurement level of your variables. The sign test requires the following variable types:
Independent variable: 2 paired groups | Dependent variable: One of ordinal level |
Note that theoretically, it is always possible to 'downgrade' the measurement level of a variable. For instance, a test that can be performed on a variable of ordinal measurement level can also be performed on a variable of interval measurement level, in which case the interval variable is downgraded to an ordinal variable. However, downgrading the measurement level of variables is generally a bad idea since it means you are throwing away important information in your data (an exception is the downgrade from ratio to interval level, which is generally irrelevant in data analysis).
If you are not sure which method you should use, you might like the assistance of our method selection tool or our method selection table.
Null hypothesis
The sign test tests the following null hypothesis (H_{0}):
- H_{0}: P(first score of a pair exceeds second score of a pair) = P(second score of a pair exceeds first score of a pair)
- H_{0}: the population median of the difference scores is equal to zero
Alternative hypothesis
The sign test tests the above null hypothesis against the following alternative hypothesis (H_{1} or H_{a}):
- H_{1} two sided: P(first score of a pair exceeds second score of a pair) $\neq$ P(second score of a pair exceeds first score of a pair)
- H_{1} right sided: P(first score of a pair exceeds second score of a pair) > P(second score of a pair exceeds first score of a pair)
- H_{1} left sided: P(first score of a pair exceeds second score of a pair) < P(second score of a pair exceeds first score of a pair)
- H_{1} two sided: the population median of the difference scores is different from zero
- H_{1} right sided: the population median of the difference scores is larger than zero
- H_{1} left sided: the population median of the difference scores is smaller than zero
Assumptions
Statistical tests always make assumptions about the sampling procedure that's been used to obtain the sample data. So called parametric tests also make assumptions about how data are distributed in the population. Non-parametric tests are more 'robust' and make no or less strict assumptions about population distributions, but are generally less powerful. Violation of assumptions may render the outcome of statistical tests useless, although violation of some assumptions (e.g. independence assumptions) are generally more problematic than violation of other assumptions (e.g. normality assumptions in combination with large samples).
The sign test makes the following assumptions:
- Sample of pairs is a simple random sample from the population of pairs. That is, pairs are independent of one another
Test statistic
The sign test is based on the following test statistic:
$W = $ number of difference scores that is larger than 0Sampling distribution
Sampling distribution of $W$ if H_{0} were true:The exact distribution of $W$ under the null hypothesis is the Binomial($n$, $p$) distribution, with $n =$ number of positive differences $+$ number of negative differences, and $p = 0.5$.
If $n$ is large, $W$ is approximately normally distributed under the null hypothesis, with mean $np = n \times 0.5$ and standard deviation $\sqrt{np(1-p)} = \sqrt{n \times 0.5(1 - 0.5)}$. Hence, if $n$ is large, the standardized test statistic $$z = \frac{W - n \times 0.5}{\sqrt{n \times 0.5(1 - 0.5)}}$$ follows approximately the standard normal distribution if the null hypothesis were true.
Significant?
This is how you find out if your test result is significant:
If $n$ is small, the table for the binomial distribution should be used:Two sided:
- Check if $W$ observed in sample is in the rejection region or
- Find two sided $p$ value corresponding to observed $W$ and check if it is equal to or smaller than $\alpha$
- Check if $W$ observed in sample is in the rejection region or
- Find right sided $p$ value corresponding to observed $W$ and check if it is equal to or smaller than $\alpha$
- Check if $W$ observed in sample is in the rejection region or
- Find left sided $p$ value corresponding to observed $W$ and check if it is equal to or smaller than $\alpha$
If $n$ is large, the table for standard normal probabilities can be used:
Two sided:
- Check if $z$ observed in sample is at least as extreme as critical value $z^*$ or
- Find two sided $p$ value corresponding to observed $z$ and check if it is equal to or smaller than $\alpha$
- Check if $z$ observed in sample is equal to or larger than critical value $z^*$ or
- Find right sided $p$ value corresponding to observed $z$ and check if it is equal to or smaller than $\alpha$
- Check if $z$ observed in sample is equal to or smaller than critical value $z^*$ or
- Find left sided $p$ value corresponding to observed $z$ and check if it is equal to or smaller than $\alpha$
Equivalent to
The sign test is equivalent to:
Two sided sign test is equivalent to- McNemar's test: $W = b$, and $z^2 = X^2$
- Friedman test with two related groups
Example context
The sign test could for instance be used to answer the question:
Do people tend to score higher on mental health after a mindfulness course?SPSS
How to perform the sign test in SPSS:
Analyze > Nonparametric Tests > Legacy Dialogs > 2 Related Samples...- Put the two paired variables in the boxes below Variable 1 and Variable 2
- Under Test Type, select the Sign test
Jamovi
How to perform the sign test in jamovi:
Jamovi does not have a specific option for the sign test. However, you can do the Friedman test instead. The $p$ value resulting from this Friedman test is equivalent to the two sided $p$ value that would have resulted from the sign test. Go to:ANOVA > Repeated Measures ANOVA - Friedman
- Put the two paired variables in the box below Measures