learntodriveai.dev/Analytics & BI/Statistical Testing: Campaign Effectiveness
Analytics & BI·Project 06·5 units

Statistical Testing: Campaign Effectiveness.

**Track:** Analytics & BI

§ Brief

You're evaluating whether a marketing campaign actually worked for a dental clinic chain in Chengdu, China — separating campaign effect from seasonality using hypothesis testing, confidence intervals, and statistical visualization.

The discipline skills: formulating business questions as testable hypotheses, selecting the right statistical test for the data type (z-test for proportions, not t-test for binary outcomes), reporting confidence intervals instead of point estimates, and communicating uncertainty honestly when the stakeholder wants a single number.

The AI-direction lesson: AI's failure mode shifts here. In previous projects, AI made computational errors — wrong aggregation levels, silent row drops. Now AI makes judgment errors: applying a t-test to binary outcome data instead of a z-test for proportions. The p-value differs and the conclusion can flip from "significant" to "not significant." The skill is verifying the method, not just the numbers. Specifying constraints before computation — "use z-test for proportions because the outcome is binary" — tells AI what not to do, which is the category of instruction AI most needs.

Your Role

You're answering a question that descriptive analysis cannot. "Did bookings go up?" is observable. "Did the campaign cause the increase?" requires a statistical test. The analytical method changes — from counting and charting to hypothesis testing with p-values and confidence intervals.

AI's failure modes change too. In previous projects, AI made computational errors — wrong aggregation levels, silent row drops, inconsistent metric definitions. Here, AI makes judgment errors: selecting the wrong statistical test for the data type. Your job is to verify the method, not just the numbers.

What's New

Last time, you built interactive plotly charts and dual-audience Metabase dashboards for Amina's bookstore chain. You planned decomposition before starting and curated context for multi-concern AI sessions.

This time, the terrain shifts. You cross from descriptive analysis to inferential statistics. "Bookings increased 22%" becomes "bookings increased between X% and Y% with 95% confidence, and that increase is / is not statistically significant after accounting for seasonality." scipy.stats and statsmodels enter.

The hard part is not the data — it is a single source, reasonably clean, with familiar columns. The hard part is framing the right hypothesis, choosing the right test, and reporting the result honestly.

Tools

  • Python 3.11+ (via Miniconda, "analytics" environment)
  • DuckDB
  • Jupyter Notebook
  • pandas
  • scipy.stats (new — hypothesis testing)
  • statsmodels (new — statistical analysis)
  • matplotlib / seaborn (statistical visualizations with confidence intervals)
  • Metabase (via Docker — continuing from previous projects)
  • Docker
  • Claude Code
  • Git / GitHub

Materials

  • Booking data — two years of daily bookings across six clinics, about 28,000 rows. Each row is a booking with date, clinic, patient type, service category, source channel, and revenue.
  • Campaign calendar — start/end dates for each channel and the cost breakdown.
  • Data dictionary — column definitions and business terminology for the booking data.
  • Statistical testing guide — hypothesis testing concepts, test selection decision tree, confidence interval reporting, and code examples for scipy.stats and statsmodels.
  • CLAUDE.md — project governance file with client context, work breakdown, and verification targets.