Statistics guides
Which test fits your data, what its assumptions actually are, and how to report it.
More reading: all topics, the blog, and the glossary of statistical terms.
Choosing a test
How to choose a statistical test for your data
Pick a test from four facts about your study: the question, the outcome type, how observations are linked, and how many groups. With a decision table.
P-values and inference
Multiple comparisons: Bonferroni, Holm, or BH
Family-wise error versus false discovery rate, how Bonferroni, Holm and Benjamini-Hochberg differ, and which post hoc test follows ANOVA or Kruskal-Wallis.
Data cleaning and missing data
How to analyse values below the detection limit
Why replacing non-detects with half the detection limit biases results, and how Peto-Peto tests and censored regression use them correctly.
How to prepare your data for statistics
Lay out your spreadsheet so any statistics tool reads it: one row per observation, one value per cell, coded categories with a codebook, ISO dates and units.
Comparing groups
ANCOVA (analysis of covariance): a practical guide
ANCOVA compares group means while adjusting for a continuous covariate such as a baseline score. What it assumes, how adjusted means work, and when to use it.
One-way ANOVA, Welch ANOVA or Kruskal-Wallis?
One-way ANOVA, Welch's ANOVA and the Kruskal-Wallis test answer different questions about three or more groups. What each tests, and a sensible default.
Paired t-test vs Wilcoxon signed-rank: which one?
Which test for before and after data? Both analyse the paired differences. What each assumes about them, how zeros and ties are handled, and what to report.
T-test vs Mann-Whitney U test: which to use?
Welch's t-test, Student's t-test or Mann-Whitney U for two groups? What each one tests, what skewed data changes, and why Welch is a sensible default.
Two-way ANOVA: interaction, main effects, post hoc
A two-way ANOVA tests two main effects and their interaction. Why to read the interaction first, how simple effects work, and where post hoc tests fit.
Categorical data
Chi-square or Fisher's exact test: which to use?
When the chi-square approximation holds, where the expected-count-of-5 rule comes from and what it says, and when to use Fisher's exact or McNemar's test.
McNemar's test for paired yes/no data
McNemar's test compares two paired yes/no measurements using only the discordant pairs. When it applies, how to read it, and exact vs corrected versions.
Odds ratio or relative risk: which to report?
Odds ratio or relative risk? What each one measures, why case-control studies can only give an odds ratio, and how to convert or choose between them.
Regression models
Logistic regression: odds ratios and separation
How to fit and read a logistic regression for a yes/no outcome: odds ratios with confidence intervals, events per variable, and what to do about separation.
Ordinal or multinomial logistic regression?
Ordinal and multinomial logistic regression both model outcomes with 3+ categories. How to choose, the proportional-odds assumption, the reference category.
Poisson or negative binomial regression?
Poisson and negative binomial regression both model counts. How to check for overdispersion, why it matters, and when negative binomial is the better choice.
Repeated measures and mixed models
Repeated-measures ANOVA or a linear mixed model?
Repeated-measures ANOVA drops anyone with a missing visit; a linear mixed model keeps every observation. When each fits, shown on one dataset run both ways.
Survival analysis
Kaplan-Meier and Cox regression for survival data
How censoring works, what Kaplan-Meier curves and the log-rank test tell you, how to read a Cox hazard ratio, and when a Weibull AFT model fits better.
Agreement and diagnostic accuracy
Bland-Altman plot: agreement between two methods
How to make and read a Bland-Altman plot: bias, limits of agreement with their confidence intervals, a proportional-bias check, sample size and R code.
Reproducible analysis
Reproducible statistical analysis: the rerun test
What a reviewer needs to rerun your analysis: the data, one script, the seed, package versions, session info and a decision record, shown on a seeded R example.