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.
| Participant | Program group | Symptom score | Pooled rank |
|---|---|---|---|
| S01 | Standard | 4 | 5 |
| S02 | Standard | 5 | 9 |
| S03 | Standard | 5 | 9 |
| S04 | Standard | 6 | 14 |
| S05 | Standard | 6 | 14 |
| S06 | Standard | 6 | 14 |
| S07 | Standard | 7 | 18 |
| S08 | Standard | 7 | 18 |
| S09 | Standard | 8 | 21 |
| S10 | Standard | 8 | 21 |
| S11 | Standard | 9 | 23.5 |
| S12 | Standard | 9 | 23.5 |
| C01 | Coached | 2 | 1 |
| C02 | Coached | 3 | 2.5 |
| C03 | Coached | 3 | 2.5 |
| C04 | Coached | 4 | 5 |
| C05 | Coached | 4 | 5 |
| C06 | Coached | 5 | 9 |
| C07 | Coached | 5 | 9 |
| C08 | Coached | 5 | 9 |
| C09 | Coached | 6 | 14 |
| C10 | Coached | 6 | 14 |
| C11 | Coached | 7 | 18 |
| C12 | Coached | 8 | 21 |
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
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.
| Score | Standard count | Coached count | Pooled positions | Average rank |
|---|---|---|---|---|
| 2 | 0 | 1 | 1 | 1 |
| 3 | 0 | 2 | 2–3 | 2.5 |
| 4 | 1 | 2 | 4–6 | 5 |
| 5 | 2 | 3 | 7–11 | 9 |
| 6 | 3 | 2 | 12–16 | 14 |
| 7 | 2 | 1 | 17–19 | 18 |
| 8 | 2 | 1 | 20–22 | 21 |
| 9 | 2 | 0 | 23–24 | 23.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
- Download the CSV and open the Wilcoxon rank-sum calculator.
- Import the file. Mark
Participant_IDas an identifier,Program_Groupas categorical, andSymptom_Scoreas numeric or ordinal. Confirm Standard is the first group and Coached the second. - Choose long format,
Symptom_Scoreas the outcome, andProgram_Groupas the grouping column. Select the two-sided alternative and leave α = .05. - 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.
- 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
- R documentation: Wilcoxon rank-sum and signed-rank tests
- NIST: Two-sample linear rank-sum test
- NIST/SEMATECH e-Handbook of Statistical Methods
- American Statistical Association statement on statistical significance and p-values
BioTabular’s editorial approach and scope explain how these educational resources are prepared and what they do not replace.