RigorMed
← Research resources

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.

Data, analysis, and reproducibility

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.

Three different meanings of a two-group comparison
ItemWorked exampleVerification
Independent continuous outcomeCompare 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 outcomeUse 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 outcomeInspect 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

  1. Build a data check sheet first

    Record outcome, target comparison, dependence, missingness, and reporting scale. Plot distributions or paired differences and investigate unusual values.

  2. 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.

  1. ICMJE Recommendations for Manuscript Preparation

RigorMed workspace

Start with your research materials

Bring your research question, available materials, and the steps you want to check.