What is a one sample median test?
There are two one sample median tests, the Wicloxon Signed Rank Test and the Sign Test. Both are simple, easy to run tests; the key is that you must choose the hypothesis for the expected mean value before running the analysis, in an a priori manner.
Choosing a One Sample Median Test for Your Data
The sign test is a good general non-parametric test, which makes very few assumptions (requirements) but has limited power. To use the sign test you need only know that every pair of data points (observations) are ordered, for instance, x > y.
So, since it begins with more assumptions, the Wilcoxon signed-rank test is more specific, with a narrower focus; but it also (usually) has more power to find differences than the more general sign test.
The One Sample Sign Test
To understand the one sample sign test, let’s look at a very simple example. Suppose you manage a zoo and you hypothesize that the median age of children visiting is 8. This becomes your null hypothesis, H0: the median age of children is 8.
Suppose now you took a sample of ten children whose ages turn out to be 1, 2, 2, 4, 5, 7, 10, 12, 15, and 17. To run the test:
Step 1: Assign a value of 0 to those with ages below your hypothesized median, and 1, to those above. If you had any eight-year-olds—which you haven’t—they would not be counted at all.
Step 2: Find the obtained frequency (of). There are six children with ages below the median (the median is 8), and four above.
of = 4 and 8.
Step 3: Find the expected frequency (ef). The total number of data points—children—is ten. If 8 was a true median, we’d expect to have five children over aged eight and five below.
ef = 5.
Step 4: Calculate the chi-square:
Χ2 = Σ [(of – ef)2/ef].
(6 – 5)2/5 + (4 – 5)2/5
or 0.20 + 0.20 = 0.40.
Since our Χ2 value of 0.40 is less than the critical Χ2 value of 3.84, we fail to reject the null hypothesis (i.e. we can keep it) —that the median age of children at the zoo is 8. If the Χ2 value we calculated from our data had been more than the critical Χ2 value, we would be able to reject the null hypothesis and postulated median age of 8.
retrieved from http://core.ecu.edu/ofe/statisticsresearch/Non-Parametric%20Tests.pdf on April 6, 2018
Stata Manual, R Signrank: Equality Tests on Matched Data
retrieved from https://www.stata.com/manuals13/rsignrank.pdf on April 6, 2018
The one sample median test—Analysis of a Single Quantitative Variable
retrieved from http://psych.unl.edu/psycrs/handcomp/hc1median.pdf on April 6, 2018
If you prefer an online interactive environment to learn R and statistics, this free R Tutorial by Datacamp is a great way to get started. If you're are somewhat comfortable with R and are interested in going deeper into Statistics, try this Statistics with R track.Comments? Need to post a correction? Please post on our Facebook page.