Skip to course content
Free Python statistics course

Statistical Data Analytics with Python

Module 06 Activity

Scenario

Compare groups with the method the design and the data actually support.

What you build

A comparison with its assumptions checked and its power stated.

Steps

  1. Decide whether the comparison is one-sample, two-sample, paired, or across three or more groups, and justify it from the design.
  2. Pass equal_var=False, and report both group SDs and both sample sizes.
  3. For paired data use ttest_rel and report the between-unit SD and the within-unit change SD.
  4. For proportions report the absolute difference with its interval and the relative change alongside.
  5. For categorical data report chi2_contingency with expected counts and standardised residuals, and switch to fisher_exact when expected counts fall below about 5.
  6. For three or more groups follow f_oneway with pairwise_tukeyhsd, never with unadjusted pairwise tests.

Evidence to hand in

Review checklist