Between-Groups Comparison (t-test and ANOVA)
Compare groups with t-tests or ANOVA, effect sizes and assumption checks — ready to report in APA.
between groups comparisonWhat it is
Between-groups comparison tests whether the average of an outcome differs across independent groups. With two groups you use an independent-samples t-test; with three or more you use a one-way ANOVA, and a significant ANOVA is followed by post-hoc tests to see which groups differ. These methods answer a simple, common question — does group membership change the outcome? — and they belong to experimental and survey research alike, wherever you compare conditions, segments or treatments.
When to use it
- You compare two independent groups on a continuous outcome (t-test).
- You compare three or more independent groups (one-way ANOVA).
- You ran an experiment with separate conditions and want to test the difference.
- You need an effect size, not just a p value, for your write-up.
When not to use it
- The same people are measured more than once — use a repeated-measures design instead.
- Your outcome is categorical — use a chi-square test rather than a mean comparison.
Assumptions
- Independent observations — each respondent is in one group only.
- The outcome is roughly normally distributed within each group (or the groups are large). If not, and the groups are small, see the Kruskal-Wallis section below.
- Homogeneity of variance across groups (Levene's test); use Welch's correction if it is violated.
- No extreme outliers distorting the group means.
Thresholds & cutoffs
| Criterion | Rule of thumb | Source |
|---|---|---|
| Significance (α) | p < .05 conventional | Standard NHST convention |
| Cohen's d (t-test) | .20 small, .50 medium, .80 large | Cohen (1988) |
| η² / partial η² (ANOVA) | .01 small, .06 medium, .14 large | Cohen (1988) |
| η²H (Kruskal-Wallis) | (H − k + 1) / (n − k); often read like η²: .01 small, .06 medium, .14 large | Tomczak & Tomczak (2014) for the formula; benchmarks from Cohen (1988) for η² |
| Levene's test | p > .05 supports equal variances | Levene (1960) |
Kruskal-Wallis test: when the outcome is not normal
The Kruskal-Wallis H test (Kruskal & Wallis, 1952) compares three or more independent groups on ranks instead of means. It is the rank-based counterpart of one-way ANOVA; for two groups the counterpart is the Mann-Whitney U test. It is a sensible choice when the groups are small and the outcome is clearly non-normal, strongly skewed or has outliers, and when the outcome is ordinal, such as a single Likert item.
Check the choice against your sample size. With larger groups (roughly n > 30 per group), ANOVA, or Welch's ANOVA when variances differ, is usually robust to non-normality, and Shapiro-Wilk flags even trivial deviations in large samples (see assumption checks). Both tests can then be defended, but they answer different questions: ANOVA compares means, Kruskal-Wallis compares rank distributions. Decide on the test before you look at the result, and say in your report why you chose it.
For moderate group sizes, H is compared with a chi-square distribution with k − 1 degrees of freedom, where k is the number of groups (an approximation; with very small groups, use exact p values). Report it as H(df) = X.XX, p = .0XX. The usual effect size is eta squared based on H: η²H = (H − k + 1) / (n − k), where n is the total sample size (Tomczak & Tomczak, 2014). For example, H = 13.22 with k = 6 groups and n = 521 gives η²H = (13.22 − 5) / 515 = .016.
A significant H only says that values in at least one group tend to be higher or lower than in another. Follow it with Dunn's test (Dunn, 1964) for the pairwise comparisons, correct the p values for multiple testing (for example with the Holm method; Holm, 1979), and report the corrected p values.
Sources: Kruskal, W. H., & Wallis, W. A. (1952), Journal of the American Statistical Association, 47(260), 583-621, doi:10.1080/01621459.1952.10483441. Dunn, O. J. (1964), Technometrics, 6(3), 241-252, doi:10.1080/00401706.1964.10490181. Tomczak, M., & Tomczak, E. (2014), Trends in Sport Sciences, 21(1), 19-25. Holm, S. (1979), Scandinavian Journal of Statistics, 6(2), 65-70.
How to report it in APA
An independent-samples t-test showed that group A (M = X.XX, SD = X.XX) scored higher than group B (M = X.XX, SD = X.XX), t(df) = X.XX, p = .0X, d = .XX. (For ANOVA: A one-way ANOVA revealed a significant effect of group, F(df1, df2) = X.XX, p = .0X, η² = .XX.)
How Explonia runs it
Explonia runs independent t-tests and one-way ANOVA in the browser on the data you collect or upload. It checks the assumptions for you — including Levene's test — applies Welch's correction when variances differ, and reports effect sizes (Cohen's d, eta-squared) alongside the test, plus post-hoc comparisons after a significant ANOVA. In Auto mode, if Shapiro-Wilk flags non-normality in any group, Explonia switches to Mann-Whitney (two groups) or Kruskal-Wallis (three or more), with η²H and Dunn's post-hoc tests with Holm correction. You can also pick the test yourself, for example ANOVA or Welch's ANOVA when the groups are large. The results draft an APA 'Article description' you can edit. Export to SPSS (.sav) and R is available on paid tiers.
Frequently asked questions
When do I use a t-test instead of ANOVA?
Use an independent t-test to compare exactly two groups, and a one-way ANOVA for three or more. An ANOVA with two groups gives the same result as a t-test.
Why should I report an effect size?
A p value tells you whether a difference is statistically significant; an effect size (Cohen's d, eta-squared) tells you how large it is. APA style asks for both. Treat Cohen's small/medium/large labels as rough conventions, not field-specific truth — a 'small' effect can be important depending on the outcome.
What if Levene's test is significant?
A significant Levene's test means the groups have unequal variances. Use Welch's t-test or Welch's ANOVA, which do not assume equal variances; Explonia applies this for you.
Which post-hoc test follows a significant ANOVA?
Tukey's HSD is a common choice for all pairwise comparisons with equal variances. Explonia runs post-hoc comparisons automatically after a significant ANOVA.
When should I use Kruskal-Wallis instead of ANOVA?
Use Kruskal-Wallis when the groups are small and the outcome is clearly non-normal, skewed or ordinal. With large groups (roughly n > 30 per group) ANOVA or Welch's ANOVA is usually robust, so a significant Shapiro-Wilk test alone is not a strong reason to switch. Whichever test you use, justify the choice in your report.
Last updated: September 2026
Run t-test / ANOVA on your own data
Collect or upload your data, run the analysis in your browser, and get a draft APA paragraph you can edit. Free to start. No credit card.
Start free