# Wilcoxon signed-rank test (/docs/analyses/wilcoxon-signed-rank)



## When to use it [#when-to-use-it]

Use the Wilcoxon signed-rank test instead of a [paired t-test](/docs/analyses/ttest-paired) when the differences are skewed or the scores are ordinal. It ranks the size of each person’s change and looks at the direction.

## Assumptions [#assumptions]

Each row is one pair. Differences of zero are ties and drop out of the rank sum.

## Running it in Tensr [#running-it-in-tensr]

<Steps>
  <Step>
    Analyze → Nonparametric Tests → 2 Related Samples. In chat: “Wilcoxon signed-rank of before and after.”
  </Step>

  <Step>
    Before column and after column are the two measurements. The ranked difference is before minus after.
  </Step>
</Steps>

## Options [#options]

<TypeTable
  type="{
  before_column: { type: 'string', description: 'First measurement.' },
  after_column: { type: 'string', description: 'Second measurement from the same cases.' },
  confidence_level: { type: 'number', description: 'Accepted on the request.', default: '0.95' },
  decimal_places: {
    type: '0–6',
    description: 'Report output. Decimal places.',
    default: '3',
  },
  apa_format: {
    type: 'boolean',
    description: 'Report output. APA-style p-values.',
    default: 'true',
  },
  include_charts: {
    type: 'boolean',
    description: 'Report output. Shared chart switch.',
    default: 'true',
  },
}"
/>

## Reading the output [#reading-the-output]

The before and after course scores. Most people gain, some lose a little, so the signed-rank statistic is not zero.

|                |  N | Mean rank | Sum of ranks |
| -------------- | -: | --------: | -----------: |
| Positive ranks | 15 |      19.9 |        298.5 |
| Negative ranks | 33 |    26.591 |        877.5 |
| Ties           |  0 |         — |            — |

Wilcoxon signed-rank test comparing `before` and `after` on 48 paired rows (W = 298.5, p = .003, r = 0.429). Effect size (medium; r \< 0.1 negligible, 0.1 ≤ r \< 0.3 small, 0.3 ≤ r \< 0.5 medium, r ≥ 0.5 large). Cutoffs: Cohen, 1988. The primary result is significant (p = .003). This is large enough, in this sample, to treat the comparison this page is about as a real association rather than noise. Metrics: W statistic = 298.5; p-value = .003; Median difference = -4.4; Effect size r = 0.429; Effect size = medium; 95% CI median diff (HL) = \[-8.3, -0.4].

## Reporting (APA 7) [#reporting-apa-7]

Wilcoxon signed-rank test comparing `before` and `after` on 48 paired rows (W = 298.5, p = .003, r = 0.429). Effect size (medium; r \< 0.1 negligible, 0.1 ≤ r \< 0.3 small, 0.3 ≤ r \< 0.5 medium, r ≥ 0.5 large). Cutoffs: Cohen, 1988. This result is significant (p = .003). The effect is moderate, so report its size with the p-value.

## Coming from SPSS [#coming-from-spss]

Analyze → Nonparametric Tests → 2 Related Samples. SPSS may label the statistic T rather than W.
