Compare two groups with a t-test or Mann-Whitney test

8 steps · about 2 h 12 min · Intermediate

  1. Learn the logic of the two-sample t-test (article, JMP Statistics Knowledge Portal, 12 min)

    Clear visuals of how the difference between means is scaled by its standard error.

  2. Practise two-sample tests and intervals (video, Khan Academy, 40 min)

    Videos and exercises on comparing two means with tests and confidence intervals.

  3. Work a two-means example by hand (article, OpenStax Introductory Statistics 2e, 25 min)

    A textbook section with a full worked example and the unequal-variance degrees of freedom.

  4. Check independence, normality and equal variances (article, Laerd Statistics, 12 min)

    Lists each assumption of the independent t-test and how to check it.

  5. Read the formal test definition (reference, NIST/SEMATECH e-Handbook, 10 min)

    The NIST handbook gives the hypotheses, statistic and decision rule in one place.

  6. Switch to Mann-Whitney U when data are skewed or ordinal (article, Wikipedia, 15 min)

    Explains the rank-based alternative and what its result actually compares.

  7. Check the Mann-Whitney assumptions (article, Laerd Statistics, 8 min)

    Shows when the test compares medians and when it only compares distributions.

  8. Run the Mann-Whitney test in Python (reference, SciPy, 10 min)

    The SciPy reference shows the call, alternatives and how to read the output.