A t-test compares the means of two groups under assumptions about the data. The Mann–Whitney test compares the ranks of two groups and does not assume a normal distribution. The choice should follow the design and the question, not a rule of thumb applied after the data are collected.
What each test asks
The t-test asks whether two group means differ more than expected from the variability within the groups. It estimates a difference and a standard error, then forms a test statistic.
The Mann–Whitney test asks whether one group tends to have larger values than the other. It ranks all observations together and compares the sum of the ranks. It is often described as a test of medians, but that is only true under additional assumptions. More generally, it tests whether the distributions differ in location.
If the question is about a mean difference and the data are approximately normal, the t-test is a natural choice. If the question is about whether one group tends to be higher, and the data are skewed or contain outliers, the rank-based test may be more appropriate.
Assumptions of the t-test
The standard two-sample t-test assumes independent observations, approximately normal distributions within groups, and, in the equal-variance version, similar variances. The Welch version relaxes the equal-variance assumption and is a sensible default when variances may differ.
Normality matters most when the groups are small. With large groups, the central limit theorem makes the test fairly robust to moderate non-normality. With three or four observations per group, a single outlier can dominate the result.
Independence is often more important than normality and is more often violated. Technical replicates from one sample are not independent biological replicates. Repeated measurements on the same animal are not independent. A t-test applied to non-independent data can give a very small p-value for a difference that is not reproducible.
Assumptions of the Mann–Whitney test
The Mann–Whitney test assumes independent observations and, for a pure location test, similarly shaped distributions. If the distributions have different shapes or spreads, a significant result may reflect the shape difference rather than a shift in the median.
The test also treats ties in a particular way. Many ties reduce the information in the ranks and can make the normal approximation unreliable. Exact methods are available for small samples.
Choosing in practice
Start with the design.
- Two independent groups, roughly normal, similar variance: Welch t-test.
- Two independent groups, skewed or with outliers: Mann–Whitney, reported as a difference in distribution.
- Paired or repeated measurements: paired t-test or Wilcoxon signed-rank test.
- More than two groups: ANOVA or Kruskal–Wallis, followed by a planned comparison.
- Counts or proportions: a model that matches the data, not a t-test on percentages.
Do not choose the test by running a normality test on a tiny sample and then switching. A normality test has low power with small samples, so it will often fail to detect non-normality even when it matters. A large sample may be flagged as non-normal for a trivial deviation. Use plots and knowledge of the measurement.
What the p-value does not tell you
A p-value is the probability of seeing a difference at least as extreme as the observed one if the null hypothesis were true. It is not the probability that the null is true, nor the probability that a result will replicate.
A small p-value from a tiny, noisy experiment can accompany a large uncertainty. Report the effect size and a confidence interval, not only the p-value. A difference that is statistically detectable may be too small to matter biologically.
A worked illustration
Suppose two treatments are compared with five independent samples each. The treated group has a higher mean, but one control value is much lower than the rest. A t-test may be pulled by that value; a rank test may be less affected.
The right response is not to pick whichever test gives a smaller p-value. Plot the data. If the low value is a plausible biological observation, keep it and use a test that matches the distribution. If it is a measurement error, document why it is excluded. Excluding an inconvenient point after seeing the result is not acceptable.
Paired data
Paired data need a paired test. If the same sample is measured before and after a treatment, the before and after values are not independent. A paired t-test analyses the differences; the Wilcoxon signed-rank test is the rank-based alternative.
A common mistake is to treat paired data as two independent groups. This discards the pairing and loses power. It can also give a misleading answer when the baseline values vary widely between samples.
Reporting
Report the test, whether it was one- or two-sided, the sample size, the effect size and the confidence interval. State whether the variances were assumed equal and which version of the test was used. For a rank test, report the median and the distribution, not only a p-value.
If you compared several outcomes, say how you handled multiple testing. A set of t-tests on many proteins or genes needs correction or a model that borrows information across outcomes.
Key points
- The t-test compares means under assumptions; Mann–Whitney compares ranks.
- Independence is more important than normality.
- Use the Welch t-test when variances may differ.
- Paired data need a paired test.
- Report effect size and uncertainty, not only p.
Common mistakes
- Choosing the test after seeing which p-value is smaller.
- Treating technical replicates as independent samples.
- Using a rank test and calling it a test of medians without checking shapes.
- Ignoring outliers instead of investigating them.
- Reporting a p-value without an effect size.
When to ask for help
If the design has repeated measures, unequal group sizes, missing values or many outcomes, ask for a review before testing. You can order an analysis or read the p-value guide. The Biostatistics & Experimental Design course covers the decision, and the free sample size calculator helps with planning.
Sources and further reading
Written by the Solagene team for research and education. Found an error? Tell us and we will correct it.