Group comparison
Mann-Whitney U Test
Compares two independent groups through their combined rank order rather than their means, without assuming a normal distribution.
Method summary
The Mann-Whitney U test pools the observations from both groups into a single ranking and compares the rank totals each group accumulates. Its null hypothesis is that a randomly chosen observation is equally likely to come from either group, which in practice reads as the two distributions not being shifted relative to one another. Because it works with ranks rather than raw values, it is less affected by outliers and by skewed distributions, which is why it is preferred over the t-test for Likert-type ordinal responses and for small samples. Alongside the rank table, the engine reports U, a Z value from the normal approximation, and the rank-biserial correlation as an effect size.
Which research questions does it answer?
- Do two user groups answer a five-point satisfaction item differently?
- Do urban and rural participants rank perceived service quality differently?
- Do the treatment and control groups differ in reaction time in a small-sample study?
- Do subscribers and non-subscribers differ in their in-app activity level?
When should you use it?
- When two independent groups are compared and the dependent variable is ordinal.
- When normality is clearly violated for a continuous dependent variable.
- When the sample is small and no strong assumption about the shape of the distribution can be made.
- When outliers pull the mean around and a comparison of means would mislead.
Required variable types
- Dependent variable: a single ordinal or continuous column coded numerically.
- Independent variable: a grouping column with exactly two categories.
- At least three valid observations per group; below that the engine returns an error.
Key assumptions
- Independence of observations
- The two groups consist of different participants and observations do not influence each other. Matched measurements call for a different test.
- At least ordinal measurement
- The values must be meaningfully rankable from low to high. On unordered categorical data the test has no meaning.
- Enough observations per group
- The Z value from the normal approximation and the p value that follows it need a reasonable number of observations in each group.
- Similar distribution shapes
- Reading the result as a difference in medians requires the two distributions to have a similar shape. When the shapes differ markedly, the test speaks about the distributions in general rather than about location.
How YouReply checks these assumptions
- Independence of observations: The panel does not check this assumption automatically; the researcher evaluates it.
- At least ordinal measurement: The method picker asks for a numeric column and a grouping column with exactly two categories; selections that do not fit dim the method.
- Enough observations per group: The engine requires at least three observations per group and refuses to run below that, stating the reason.
- Similar distribution shapes: The panel does not compare distribution shapes; that judgement is left to the researcher, using descriptives and plots.
How the analysis is run
- 1Upload your data file and confirm on the Data tab that the columns were read correctly.
- 2On the Variable tab set the measurement level of the ordinal variable and confirm the grouping column has two categories.
- 3On the Analysis tab choose the Mann-Whitney U test; the data requirements box lists which columns qualify.
- 4In the parameter form select the grouping column and the variable to compare, setting the direction of the test if you need a one-sided hypothesis.
- 5Run the analysis. The rank table, U and Z values, the p value and the effect size open as separate sections.
- 6Download the results as Excel; the computation credits card shows the library call that produced them.
Statistics and tables produced
- Rank table
- Sample size, mean rank and rank sum per group; this is the table the interpretation rests on.
- U and Wilcoxon W statistics
- The U value is reported together with its equivalent Wilcoxon rank-sum statistic.
- Z value
- The standardised value from the normal approximation, which the p value is based on in larger samples.
- Asymptotic p value
- Reported as two-tailed or one-tailed according to the direction selected.
- Effect size
- The rank-biserial correlation is returned with a label describing its magnitude.
Effect size and confidence intervals
- Rank-biserial correlation
- Summarises how often an observation drawn from one group outranks one drawn from the other. Absolute values near 0.1 count as small, near 0.3 as medium and 0.5 and above as large; the sign shows which group ranks higher.
No confidence interval is computed either for the shift in location or for the effect size; the results are point estimates. An interval for a difference in medians has to be obtained separately.
Example research question and example result
The numbers below are a representative example, not data from a real study or a real user.
- Research question
- In a usability study, do independent groups testing two interface designs rate task difficulty differently on a five-point item?
- Variables
- Dependent variable: perceived task difficulty (1-5, ordinal) · Independent variable: interface design (A / B)
- Example result
- Group A (n = 34) had a mean rank of 29.1 and group B (n = 31) a mean rank of 37.3. U = 394.5, Z = -1.98, p = 0.048, rank-biserial correlation = 0.25.
- Interpretation
- Participants who used design B rank systematically higher on the difficulty item. The effect sits between small and medium and the p value is close to the threshold, so this single-item result should be weighed together with other measures such as task completion time.
Real output on a sample dataset
The results below were produced by the analysis engine from this data file. Changing the variable changes the research question as well; every run was computed in advance, so the page sends no request to the engine.
General customer survey (synthetic)
A wide survey of three hundred respondents: two and three category grouping variables, continuous measures, a five point ordinal scale, a binary purchase outcome, a four category brand choice, three repeated measurements, paired binary questions, three raters, four price questions and deliberately empty cells.
- Rows
- 300
- Columns
- respondent_id, gender, education, region, age, income, satisfaction, service_score, price_score, quality_score, loyalty, nps_score, purchased, brand_choice, satisfaction_level, pre_score, post_score, measure_1, measure_2, measure_3, use_before, use_after, use_followup, rater_1, rater_2, rater_3, price_too_cheap, price_cheap, price_expensive, price_too_expensive, feedback_score, followup_rating
The data is synthetic: it comes from a fixed random seed, not from a real study. The values below were produced by the analysis engine from this file, so uploading the same file to the panel gives the same results.
Research question: Does the satisfaction distribution differ between female and male respondents?
- Grouping variable
- gender
- Measured columns being compared
- satisfaction
- Direction of the test
- two-sided
- Grouping variable
- gender
- Analyzed variable
- satisfaction
Ranks
| Row | Female | Male | Total |
|---|---|---|---|
| Sample Size | 159 | 141 | 300 |
| Mean Rank | 154.33 | 146.18 | - |
| Sum of Ranks | 24,538.00 | 20,612 | - |
Test statistics
- Mann-Whitney U
- 11,818
- Wilcoxon W
- 24,538
- Z
- 0.811
- Asymptotic significance (2-tailed) (p)
- 0.417
Effect size
- Rank-biserial correlation
- -0.054
Computation credits: scipy 1.18.0 · statsmodels 0.14.6 · scikit-learn 1.9.0 · numpy 2.5.1 · pandas 3.0.5 · semopy 2.3.11 · 89fc29a · Data seed: 20260914
How to report the result
Perceived task difficulty differed significantly between the two designs, U = 394.5, Z = -1.98, p = .048, r = .25 (mean rank 29.1 for design A and 37.3 for design B).
An example sentence close to APA style; the numbers are representative.
When you should not use it
- Not for three or more groups; the Kruskal-Wallis test covers that case.
- Not for before-and-after measurements on the same people; a matched design calls for the Wilcoxon signed-rank test.
- When the group distributions have clearly different shapes, the result cannot be read as a difference in medians.
- On short scales with many tied values the ranking carries less information and the test loses power.
- With continuous data that does satisfy normality it has less power than the t-test, so prefer the parametric test when the assumptions hold.
What to use when the assumptions are not met
- Independent Samples t-TestWhy: When the dependent variable is continuous and normality holds, allowing the difference in means to be interpreted directly.
- Kruskal-Wallis H TestWhy: When three or more groups are compared; it extends the same rank logic beyond two groups.
- Wilcoxon Signed-Rank TestWhy: When the measurements are matched or come from the same people, so independence does not hold.
Frequently asked questions
- Does this test compare medians?
- It compares ranks rather than medians directly. Reading the outcome as a difference in medians requires the two groups to have similarly shaped distributions; when the shapes differ, the test says the distributions differ in general.
- Should I use this instead of a t-test on Likert items?
- For a single Likert item, which is an ordinal measurement, this test is the more defensible choice. For multi-item scales that produce a total score, treating the total as continuous and running a t-test is common in the literature; either way you are expected to justify the choice.
- My sample is very small, can I trust the p value?
- The panel derives the p value from a normal approximation, which becomes less reliable with very small groups. Interpret it cautiously alongside the effect size and the rank table.
- How do tied values affect the result?
- Tied values receive the average rank. On short scales with many ties the ranking carries less information, the test loses power and the p value can come out larger than the data would otherwise suggest.
References
- Siegel, S., & Castellan, N. J. (1988). Nonparametric Statistics for the Behavioral Sciences
- Conover, W. J. (1999). Practical Nonparametric Statistics
- scipy.stats.mannwhitneyu documentation
Try it with your own data
The free plan includes 50 analysis runs a month and needs no card.