← All resources

WORKED EXAMPLE · TWO INDEPENDENT GROUPS

Wilcoxon Rank-Sum Worked Example: Independent Symptom Scores

Follow two independent groups with tied 0–10 symptom scores from pooled average ranks through the Wilcoxon rank-sum statistic, tie-aware p-value, interpretation, and BioTabular setup.

Published by BioTabularLast reviewed: November 7, 2026

Imagine 24 independently sampled people enrolled in one of two existing support programs, Standard or Coached. At the same follow-up point, each person reports one symptom score on an integer scale from 0 (no symptoms) to 10 (most severe). This is an observational teaching dataset; program assignment was not randomized. The question is whether the follow-up score distributions differ between groups. One participant supplies one score, so there is no before-and-after pairing to preserve.

Define the design and comparison

Observational unit
One independent participant measured once at follow-up.
Group variable
Standard or Coached program, with 12 participants in each.
Outcome
Ordered integer symptom score, 0–10; lower means fewer symptoms.
Question
Do the two follow-up score distributions differ?
Method
Two-sided Wilcoxon rank-sum test (Mann–Whitney U).

The rank-sum test is appropriate for a rank-based comparison of independent groups. It does not require us to treat a one-point increase at every point on the scale as an equal clinical change. The method is not simply a substitute for a t-test after a failed normality check: it answers a different, rank-based question. If the study target were a mean score difference, we would choose and justify a method for that target instead.

Inspect all 24 scores

The table displays every row of the downloadable CSV. The rank column is added for teaching and is calculated after pooling both groups; it is not a CSV variable. IDs identify participants but do not enter the statistic.

ParticipantProgram groupSymptom scorePooled rank
S01Standard45
S02Standard59
S03Standard59
S04Standard614
S05Standard614
S06Standard614
S07Standard718
S08Standard718
S09Standard821
S10Standard821
S11Standard923.5
S12Standard923.5
C01Coached21
C02Coached32.5
C03Coached32.5
C04Coached45
C05Coached45
C06Coached59
C07Coached59
C08Coached59
C09Coached614
C10Coached614
C11Coached718
C12Coached821

Standard scores have median 6.5 and IQR 2.25; Coached scores have median 5 and IQR 2.25 using BioTabular’s interpolated quartiles. The medians summarize these samples. Their difference of 1.5 score points is descriptive, not the statistic tested below.

See the group distributions

Dot plot with Standard and Coached groups on the horizontal axis and symptom score on the vertical axis. Standard scores range from 4 to 9 and Coached scores from 2 to 8; tied dots are spread narrowly within each group.
Each dot is one participant. Narrow horizontal spacing separates tied scores without changing their vertical values. Standard scores generally sit higher, although the groups overlap.

The overlap matters. Rank-sum does not require complete separation, and a significant result does not mean every Standard participant scored higher than every Coached participant. The plot also helps check for markedly different shapes or unusual clusters that could complicate a simple location-shift interpretation.

Pool scores and assign average ranks

Sort all 24 scores together from low to high, regardless of group. An untied score receives its position from 1 to 24. When scores tie, each tied observation gets the average of the positions it occupies. Five people scored 5; their positions are 7 through 11, so all five receive rank 9. Five people scored 6; their positions are 12 through 16, so each receives rank 14. The same rule handles the other ties.

ScoreStandard countCoached countPooled positionsAverage rank
20111
3022–32.5
4124–65
5237–119
63212–1614
72117–1918
82120–2221
92023–2423.5

The Standard ranks sum to 190, giving a mean rank of 190 ÷ 12 = 15.833. The Coached ranks sum to 110, giving a mean rank of 110 ÷ 12 = 9.167. Across all participants the rank total is 300, which equals 1 + 2 + … + 24. Mean ranks describe where each group lies in the pooled ordering; they are not average symptom scores.

Calculate the statistic and p-value

BioTabular follows R’s convention for the first group: subtract its minimum possible rank sum from its observed rank sum. With Standard first, W = 190 − 12(13)/2 = 112. This is also the Mann–Whitney U for Standard under this convention. Reversing the group order would report W = 32 for Coached, while the two-sided p-value would be unchanged. Always state which group was first when reporting W.

Under the null model, the expected W is 12 × 12 ÷ 2 = 72. Because the scores repeat, BioTabular uses a normal approximation with a variance adjusted for tied ranks. It applies a 0.5 continuity correction when translating this discrete statistic to a continuous normal curve. Here the tie-adjusted variance is 292.9565, so z = (112 − 72 − 0.5) ÷ √292.9565 = 2.308 and the two-sided p = .0210. This is an approximate p-value, not an exact permutation p-value. Modern R can compute a conditional exact result with ties; to reproduce this specific BioTabular approximation in R, request exact = FALSE and correct = TRUE.

Included
12 Standard; 12 Coached; omitted 0
Median (IQR)
Standard 6.5 (2.25); Coached 5 (2.25)
Mean ranks
Standard 15.833; Coached 9.167
Rank-sum statistic
W = 112, Standard first
Two-sided p-value
.0210
Computation
Tie-aware normal approximation with continuity correction

At α = .05, the sample provides evidence against equal score distributions under the rank-sum null model. The higher Standard mean rank agrees with the higher score positions in the figure. A rank-sum result does not automatically estimate a difference in medians: that interpretation needs suitable distributional shapes and a defensible location-shift model. The p-value does not measure the size or clinical importance of a program contrast.

Reproduce the result in BioTabular

  1. Download the CSV and open the Wilcoxon rank-sum calculator.
  2. Import the file. Mark Participant_ID as an identifier, Program_Group as categorical, and Symptom_Score as numeric or ordinal. Confirm Standard is the first group and Coached the second.
  3. Choose long format, Symptom_Score as the outcome, and Program_Group as the grouping column. Select the two-sided alternative and leave α = .05.
  4. Run the analysis. Confirm 12 scores per group, no omissions, medians 6.5 and 5, W = 112, and p = .021 after display rounding. The result should state a normal approximation with continuity correction.
  5. Use Plot Studio for a second view of the group distributions, keeping the score scale and group labels visible.

Interpret and report carefully

“In this synthetic observational sample, follow-up symptom scores were compared between 12 Standard and 12 Coached participants. Median scores were 6.5 and 5, respectively. A two-sided Wilcoxon rank-sum test with Standard as the first group, average ranks for ties, and a continuity-corrected normal approximation gave W = 112, p = .021. The distributions overlapped, but Standard scores generally ranked higher.”

Report the scale direction, group sizes, missing observations, and why the groups can be treated as independent. If program enrollment differed by baseline severity or other factors, an unadjusted rank comparison cannot separate those factors from the observed association. A causal conclusion would require an appropriate study design and analysis, not only a small p-value.

Common mistakes and limits

  • Pairing Standard and Coached rows because their IDs have matching numbers. The IDs do not identify matched participants.
  • Ranking within each group rather than pooling all 24 scores first.
  • Assigning arbitrary distinct ranks to repeated scores or treating ties as measurement errors.
  • Confusing the rank sum 190 with the reported R-style W = 112.
  • Reading the difference in sample medians as the effect estimated by the rank-sum statistic.
  • Calling the result exact despite ties and BioTabular’s approximation.
  • Assuming the higher Standard ranks prove that coaching reduced symptoms.

This intentionally small, complete dataset has no clustering, missing scores, covariate adjustment, or enrollment bias model. Real symptom scales may have floor effects and different group shapes. If you need an adjusted effect, a confidence interval for a prespecified contrast, or a cluster-aware analysis, choose a method designed for that target. Do not pick a one-sided alternative after seeing the direction of the data.

Related resources

Compare this independent two-group test with the Wilcoxon signed-rank example for paired before-and-after scores and the Kruskal–Wallis example for three independent groups. The Welch t-test example answers a mean-difference question. Review Paired vs. Independent Samples before choosing between independent and matched methods.

References and further reading

BioTabular’s editorial approach and scope explain how these educational resources are prepared and what they do not replace.