Research methods guide
How to choose a statistical test for two groups
Start with the outcome type, independent or paired structure, target contrast, and assumptions. The test and results table should describe the same comparison.
Define the estimand and whether observations are independent, paired, or categorical. The table gives synthetic scenarios and adaptable R commands.
Three different meanings of a two-group comparison
Record analysis unit, contrast, outcome type, and planned outputs.
| Item | Worked example | Verification |
|---|---|---|
| Independent continuous outcome | Compare mean scores with t.test(score ~ group, data = d) in R. | Confirm two group levels and one row per person, then report the mean difference, direction, and interval. |
| Paired continuous outcome | Use t.test(d$after, d$before, paired = TRUE) for within-person differences. | Align records by ID and count complete pairs. Use a model suited to repeated measures or clustering when needed. |
| Independent binary outcome | Inspect expected counts with chisq.test(tab)$expected. For sparse 2×2 tables, consider fisher.test(tab). | Record counts and denominators and give an appropriate risk difference, risk ratio, or odds ratio with uncertainty. |
Apply the method to your materials
Build a data check sheet first
Record outcome, target comparison, dependence, missingness, and reporting scale. Plot distributions or paired differences and investigate unusual values.
Specify what a rank test answers
A rank-sum test compares ranks. A location or median interpretation needs additional assumptions. Document ties and the effect measure.
Questions that arise in practice
Should a significant normality test trigger a rank-sum test?
Start from the target contrast, then consider sample size, unusual values, and design. Switching automatically can change the research question.
Verified sources
The official sources below were checked on 2026-11-12. Access conditions and update dates are rechecked before publication.
RigorMed workspace
Start with your research materials
Bring your research question, available materials, and the steps you want to check.
