Skip to course content
Free Python statistics course

Statistical Data Analytics with Python

Module 02 Activity

Scenario

A dataset has arrived for a comparison. Establish what one row is and whether the table can support the test at all.

What you build

An analysis table with a stated grain, declared dtypes and a passing check dictionary.

Steps

  1. Write down the outcome, predictor, grouping, unit and time window before touching the data.
  2. Set the dtype of every column deliberately — Categorical for groups, ordered=True for ordinal scales, nullable integers for counts.
  3. Count missing values by group with count in the aggregation, and report whether missingness is balanced.
  4. Compare len(df) with df[unit].nunique(). If units repeat, aggregate before testing.
  5. Set the reference level explicitly with C(var, Treatment(reference=...)).
  6. Run a dictionary of boolean checks and treat every failure as a question for the data owner.

Evidence to hand in

Review checklist