library(rstatix)
ToothGrowth %>%
group_by(supp) %>%
shapiro_test(len)# A tibble: 2 × 4
supp variable statistic p
<fct> <chr> <dbl> <dbl>
1 OJ len 0.918 0.0236
2 VC len 0.966 0.428
A decision guide — match your research question to the right statistical test, know the assumptions behind it, and switch to a non-parametric test when they fail
A decision guide to choosing the right statistical test in R. Match your research question (correlation, comparing two or more groups, comparing variances) to the correct parametric test, understand the normality and equal-variance assumptions behind it, learn how to check them, and know which non-parametric test to use when they are violated — with links to a worked lesson for each.
June 23, 2026
July 7, 2026
Choosing a statistical test comes down to two questions: what are you asking? and does your data meet the test’s assumptions? This guide maps the most common research questions to the right test, explains the assumptions behind the parametric tests, and points to the non-parametric fallback when those assumptions fail — with a worked, runnable lesson behind every link.
The most common research questions and their tests:
| Your question | Parametric test | Non-parametric alternative |
|---|---|---|
| Are two variables correlated? | Correlation test (Pearson) | Correlation test (Spearman/Kendall) |
| Are several variables correlated? | Correlation matrix / correlogram | — |
| Do two groups differ? | t-test | Wilcoxon test · sign test |
| Do more than two groups differ? | ANOVA | Kruskal-Wallis (independent) · Friedman (repeated) |
| Do the variances differ? | F-test / Bartlett / Levene | Fligner-Killeen |
| Compare proportions? | Proportion z-test | exact binomial test |
For comparing groups, the next branch is how many factors and between- vs within-subjects: one factor → one-way ANOVA; two → two-way; repeated measures → repeated-measures or mixed ANOVA; with a covariate → ANCOVA; several outcomes → MANOVA.
Correlation, the t-test and ANOVA are parametric — their p-values are trustworthy only when the data behave as the test assumes. The two key assumptions are:
Take these seriously: a parametric test on data that badly violate them can give a misleading conclusion.
Before running a parametric test, run the preliminary checks. Here is the pattern — summarise, then test normality — on the built-in ToothGrowth data:
# A tibble: 2 × 4
supp variable statistic p
<fct> <chr> <dbl> <dbl>
1 OJ len 0.918 0.0236
2 VC len 0.966 0.428
VC is clearly normal (p = 0.43), while OJ shows a mild deviation (p = 0.024). With only ~30 observations per group and a borderline p-value, this is exactly the case to inspect the Q-Q plot and use judgement rather than reject normality outright — Shapiro-Wilk is sensitive, and at this sample size the central limit theorem makes the t-test fairly robust. See the dedicated lessons for the full workflow: normality (Shapiro-Wilk + Q-Q) and homogeneity of variance (Levene’s test).
Large samples relax normality. With more than ~30 observations per group, the central limit theorem means parametric tests cope well with mild non-normality — the Shapiro-Wilk test also becomes oversensitive at large n, so lean on the Q-Q plot and your judgement rather than the p-value alone.
If normality or equal variance is clearly violated, you have three routes:
Check the assumptions on a dataset, then decide. The sandbox boots on first Run.
Ask Prova “here’s my data and my question — which statistical test should I use, what assumptions does it need, and how do I check them?” — it answers with rstatix code you can run on your own data and walks you to the right test. The runtime is the judge. Ask Prova →
Match your question to the test: correlation for associations between variables; the t-test (or Wilcoxon) for two groups; ANOVA (or Kruskal-Wallis) for several groups; a variance test for spread; a proportion test for rates. Then choose the parametric version if the normality and equal-variance assumptions hold, or the non-parametric version if they don’t.
A parametric test (t-test, ANOVA, Pearson correlation) assumes the data follow a particular distribution — usually normal — and tests parameters like the mean. A non-parametric test (Wilcoxon, Kruskal-Wallis, Friedman, Spearman) works on ranks and makes no distributional assumption, so it is used when the parametric assumptions fail, at some cost in power.
Mainly two: the outcome (or the model residuals) is approximately normally distributed, and the groups being compared have equal variances (homogeneity of variance). Observations are also assumed to be independent. Check normality with Shapiro-Wilk + a Q-Q plot and equal variance with Levene’s test before trusting the result.
You have three options: use the non-parametric counterpart of your test (Wilcoxon, Kruskal-Wallis, Friedman); use a robust variant (Welch); or transform the data (log, square-root) to restore normality. With large samples (n > 30) the central limit theorem often makes the parametric test acceptable anyway.
Choosing a statistical test is a two-step decision: match the test to your research question (how many variables or groups, and what you’re comparing), then verify its assumptions — normality and equal variance for the parametric tests. When the assumptions hold, the parametric test (t-test, ANOVA, correlation) is the most powerful choice; when they don’t, switch to the non-parametric counterpart or transform the data. Each test linked above has a full, runnable lesson to take you from question to reported result.
Prove you can do it. Master the whole Statistical Assumptions in R series — track your path, build projects, and earn a certificate.
Go Pro — unlimited Prova on your own data and a verifiable certificate that proves the skill.
from $15/mo billed yearly
✓ You're Pro — keep going. The runtime is the judge.
Ready to level up?
Get new R & Python lessons by email
Practical, reproducible, no spam. Unsubscribe anytime.
Double opt-in. We never share your email.
Every result on this page was produced by the code shown, run at build time against a pinned R environment — edit any block and Run to reproduce it yourself.
@online{2026,
author = {},
title = {Statistical {Tests} and {Assumptions} in {R:} {Which} {Test}
{Should} {I} {Use?}},
date = {2026-06-23},
url = {https://www.datanovia.com/learn/biostatistics/assumptions/statistical-tests-and-assumptions},
langid = {en}
}