The one-sample Wilcoxon is a non-parametric hypothesis test compare the median value of one sample with one hypothesized value.

For run this test it’s important that:

  • The sample doesn’t need to come from a normal distribution;
  • Data need to be continuous;
  • Observation are mutually indipendet each other.

In this case the hypothesis are like (in case of two tail test):

  • H0: The median is equal to a specific value;
  • H1The median is different to the specific value.

The way to conduct the hypothesis test is like the one-sample t-tests, but we use another statistics.

For run this test you need:

  • Identify the meadian value of the sample;
  • For each observation compute the difference between the observation and the sample. If the difference is 0 ignore that observation;
  • Order the difference value and, ignoring the sign of the difference, give a rank (1,2,3,etc) for each difference;
  • Compute the sum of the rank of the positive difference W+ and the negative difference W-
  • The test statistics is the min value between W+ and W-

For small number of observation you can look at the critical value in the Wilcoxon test table (using alpha and n, the number of observation). So you can easy test if W is bigger than ther critical value.

For big number of observaion (n>30), you have an approximation of the normal distribution and you can calculate the the Z-score using the formula in image1.

image1 - Wilcoxon Z-Value formula
image1 – Wilcoxon Z-Value formula

With the Z-Score, you can get your p-value by looking at the probability of the Z distribution on the Z Table that you can find on google. After that, you can compare the P-value with alpha. In case of a two-tailed test, remember to multiply for two your p-value.

Share on: