Choosing a statistical test looks hard, but a few questions lead you to the right family of tests. Ask them in order: what is my question, what type of data do I have, how many groups, and are the groups independent or paired?
Ask these questions
- What do I want to know? Compare groups, find a relationship, or predict?
- What type is my outcome? Numerical (such as weight or pH) or categorical (such as pass or fail)?
- How many groups or conditions am I comparing? Two, or three and more?
- Are the groups independent (different samples) or paired (the same samples measured twice)?
- Are numerical data roughly normally distributed, and is the sample size large enough? If not, use a non-parametric test.
Decision guide
| Question | Data and design | Usual test | If assumptions fail |
|---|---|---|---|
| Compare 2 groups | Numerical, independent groups | Independent t-test | Mann-Whitney U test |
| Compare 2 conditions | Numerical, paired data | Paired t-test | Wilcoxon signed-rank test |
| Compare 3 or more groups | Numerical, independent groups | One-way ANOVA (then a post-hoc test) | Kruskal-Wallis test |
| Compare 3 or more conditions | Numerical, repeated measures | Repeated-measures ANOVA | Friedman test |
| Compare proportions | Two categorical variables | Chi-square test | Fisher's exact test (small counts) |
| Relationship between 2 variables | Two numerical variables | Pearson correlation | Spearman correlation |
| Predict one variable from others | Numerical outcome | Linear regression | Transform data or use a suitable model |
Good habits
- Look at your data with a chart before testing.
- Decide the test and the significance level before looking at the results.
- Report the effect size and a confidence interval, not only the p-value. A small p-value does not mean a large or important effect.
- Do not run many tests until one is significant. If you compare many groups, use an appropriate method for multiple comparisons.
- Use software such as Excel, SPSS, R or Jamovi, and keep your steps recorded.
Example
You measure the moisture of bread from two ovens, with 10 loaves each. The data are numerical, there are two independent groups, and the values look roughly normal. Use an independent t-test.
Key points
- Choose the test from the question, the data type, the number of groups and the design.
- Paired and independent data need different tests.
- Check assumptions, and use a non-parametric test if they fail.
- Report effect size and confidence intervals, not only p-values.
Frequently asked questions
What does the p-value mean?
It is the probability of seeing a result at least as extreme as yours if there were really no effect. It does not tell you the size or importance of the effect.
How do I check if data are normal?
Look at a histogram or Q-Q plot, and use a test such as Shapiro-Wilk. With small samples, be careful, and use a non-parametric test if in doubt.
When should I use a non-parametric test?
When data are clearly not normal, are ranks or scores, or the sample is very small and the assumptions cannot be checked.
This lesson is for education. Always follow the food law and the requirements of your own country, authority or customer.
