learntodriveai.dev/Analytics & BI/Statistical Testing: Campaign Effectiveness
Analytics & BIProject 065 unitsVerified on 16 October 2026

Statistical Testing: Campaign Effectiveness

Wei LiangDirector of Marketing · Dental clinic chain · Chengdu, China
Message · from Wei
I need an analysis of whether our recent marketing campaign actually drove new patients or whether the increase we observed was seasonal. … The board meets in three weeks. I need a clear answer.
Chat with Wei

What you hand back

  • Hypotheses and test choice, written down
  • Campaign effect with p-value and confidence interval
  • Channel and service category test results
  • Charts and a dashboard showing uncertainty
  • Cost per incremental patient as a range
  • Board email stating what can and cannot be concluded

5 units

  1. Unit 1: Wei's email and the booking data

    Read Wei's email, set up the project, and profile the booking data, clinic start dates and source tags.

    Open unit 1
  2. Unit 2: Framing testable hypotheses

    Ask about the late-opening Gaoxin clinic, then frame the null and alternative hypotheses and fix the z-test for proportions.

    Open unit 2
  3. Unit 3: Running the statistical tests

    Run the z-test and chi-squared test, compute the confidence interval, and break results down by channel and service.

    Open unit 3
  4. Unit 4: Communicating uncertainty

    Chart the effect with error bars, write findings in uncertainty language, build the dashboard, and give cost per patient as a range.

    Open unit 4
  5. Unit 5: Project close

    Send Wei the findings email, defer the retention request, write the README, and push the repository.

    Open unit 5
Read the full 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.
Materials · 10 files
Start Project 6

You work at a computer with a terminal. Signed in, your place is saved.