Contents/ Part XXVII · Capstone Projects: Statistical Testing/ Chapter 169

Did the Campaign Beat Its Target?

Capstone 10. Two questions about rates, from one dataset. Did campaign A clear its 7% target, and does campaign B convert better than A? One question gets a clear answer and the other does not, and understanding why is the whole lesson.

⏱️ ~16 min read
🧪 Proportion z-tests
📊 Chapter 169

Rates are everywhere in business: conversion rates, click rates, defect rates, churn. They look like averages, and in a sense they are, but the outcome behind them is binary, one or zero for each person. That changes the arithmetic of the standard error and gives this family its own tests.

The brief
Setting
Two email campaigns ran at the same time and every visitor saw exactly one. Signups were recorded for each.
The question
Did campaign A beat the 7 percent target, and does campaign B beat campaign A?
Why it matters
These are two separate business decisions. One settles whether the channel is worth keeping at all; the other settles which creative to send next quarter.
What we do
Run a one-sample proportion test against the fixed target and a two-sample test between campaigns, show why the same data supports two very different headlines, and work out what this sample size could have detected.
A proportion z-test compares a rate either against a fixed target (one-sample) or against another rate (two-sample). It relies on a normal approximation that needs roughly 10 successes and 10 failures per group; below that, the exact binomial test takes over.
✉️
The finding, up front

Two questions, two different verdicts. Campaign A came in at 7.54% against a 7% target, but that gap is not distinguishable from noise (p = 0.41, 95% CI 6.3% to 9.0%, which contains 7%). Campaign B at 11.41% clearly beats A (p = 0.0003, +3.87 percentage points, CI +1.8 to +6.0). The same dataset answers one question decisively and the other not at all.

1

Two Questions, Two Tests

Two email campaigns ran at the same time and every visitor saw exactly one. Marketing asked two things, and they are genuinely different questions requiring different tests.

Comparing a rate to a target, or to another rate ONE-SAMPLE · rate vs a target 7.54% campaign A (estimated) vs 7% target (a fixed number) only one quantity carries uncertainty TWO-SAMPLE · rate vs rate 7.54% campaign A vs 11.4% campaign B both quantities carry uncertainty

The distinction is not cosmetic. In the one-sample test the target is a fixed number chosen by the business, so only the observed rate wobbles. In the two-sample test both rates are estimates, so the comparison must carry both sources of uncertainty.

2

Clean, Then Check the Assumption

Only two fixes are needed here: drop duplicate rows, and drop visitors whose outcome was never recorded. A missing outcome must not be quietly counted as a non-signup, because we do not know that it was one.

Both proportion tests rest on a normal approximation to the binomial, which needs enough events and enough non-events, conventionally at least 10 of each. With well over a thousand visitors per campaign and 113 and 171 signups, that condition is met with enormous margin.

CampaignSignupsVisitorsRateSuccesses / failures
A1131,4997.54%113 / 1,386 ✓
B1711,49911.41%171 / 1,328 ✓
3

Question 1: Did A Beat the 7% Target?

Campaign A converted at 7.54%, which is numerically above the 7% target. It is tempting to stop there and report a win.

Observed rate
7.54%
113 of 1,499
z statistic
0.82
against a 7% target
p-value
0.41
not significant
95% CI
6.3% – 9.0%
contains 7%

The test cannot distinguish 7.54% from 7%. The confidence interval runs from 6.3% to 9.0% and comfortably contains the target, so the data are equally consistent with A running slightly below target as slightly above it. The exact binomial test agrees (p = 0.42), confirming this is not an artifact of the normal approximation.

What to say, and what not to say

The honest statement is not "A beat its target" and not "A missed its target". It is "A is running at about its target, and this sample cannot tell us which side of it". Reporting a win from a 7.54% observation would be reading noise as signal, and "not significant" here means inconclusive, not no difference.

4

Question 2: Does B Beat A?

The second question uses the same dataset and gets a completely different quality of answer.

z statistic
3.62
B versus A
p-value
0.0003
clearly significant
Difference
+3.87 pp
11.41% vs 7.54%
95% CI
+1.8 to +6.0 pp
excludes zero
Two panels. On the left, the signup rates of campaigns A and B with 95% confidence intervals against a dashed red 7 percent target line; campaign A's interval straddles the target line while campaign B's sits well above it. On the right, the difference between B and A plotted as a point at about 3.9 percentage points with a confidence interval from 1.8 to 6.0, entirely to the right of a dashed zero line.
Left: campaign A's interval straddles the target, which is why question 1 was inconclusive; campaign B's sits clearly above it. Right: the gap between the campaigns is well separated from zero, which is why question 2 was easy.

Why did the same data answer one question and not the other? Because of the size of the gap being asked about. Question 1 was about a 0.54 point difference; question 2 was about a 3.87 point difference, seven times larger, from the same number of visitors.

5

The Same Win, Two Very Different Headlines

The gap between the campaigns can be reported as 3.87 percentage points or as a 51% relative lift. Both are arithmetically correct, and they leave completely different impressions.

One result, two honest headlines RELATIVE FRAMING +51% "a 51 percent lift" sounds transformative ABSOLUTE FRAMING +3.9 pp "about 387 more signups per 10,000 visitors" sounds modest, and is checkable Relative figures exaggerate when the base rate is small. Report the absolute difference with its interval, then translate it.

Relative figures inflate when the base rate is small, and a 7.5% base rate is small. The reporting discipline from Chapter 157 applies directly: give the absolute difference with its interval, then translate it into something concrete, here about 387 extra signups per 10,000 visitors. Quote the relative lift alongside if you like, never instead.

6

The Verdict and Its Limits

If the decision is which campaign to run, the evidence supports B. If the question is whether A meets its 7% target, the answer is that we cannot yet tell, and a larger sample would be needed to resolve it.

7

Proportion Tests in Data Science & AI

Binary outcomes are the most common outcome type in product analytics, so this is probably the most-run test in the industry.

Where it appearsThe proportion
Conversion A/B testsShare of users who complete a target action, variant against control.
Model accuracy comparisonShare correct for two classifiers on the same held-out set.
Quality and defect ratesShare of units failing inspection, against a contractual threshold.
Fairness metricsSelection rates compared across groups, as in Chapter 158.
Practice note

Two habits separate reliable experimentation teams from unreliable ones. First, a power calculation before launch: deciding the minimum lift worth detecting and sizing the test for it, which would have revealed in advance that this sample could never resolve a 0.5-point question. Second, no peeking: fixing the horizon or adopting a sequential design. Both failures produce confident conclusions from tests that never had the resolution to support them.

8

What Could This Study Have Detected?

Campaign A came back inconclusive against the 7 percent target: p = 0.41, and the interval covers the target. That is not the same as showing A hits the target, and before anyone treats it as reassurance the honest follow-up is to ask what gap this sample was capable of finding.

QuestionAnswer
What precision did we get?7.54%, margin of error ± 1.34 percentage points
Smallest gap detectable at 80% power1.96 pp, i.e. a true rate of 8.96% or higher
Smallest gap detectable at 90% power2.29 pp, i.e. a true rate of 9.29%
Sample needed to confirm the observed 0.54 pp gapabout 18,000 visitors, roughly 12× this study
A power curve showing the chance of detecting a difference against campaign A's true signup rate. A shaded band covers rates from about 5 to 9 percent where power is below 80 percent. A vertical line marks the observed 7.54 percent, sitting inside the shaded band.
The shaded band covers every true signup rate this study had less than an 80 percent chance of flagging, and it swallows everything from roughly 5.0 to 9.0 percent. The observed 7.54 percent sits in the middle of it.
Absence of evidence, quantified

With 1,500 visitors this test could only have reliably caught a true rate around 9 percent or higher. Campaign A's 7.54 percent sits comfortably inside the range the study was never equipped to resolve, so "not significantly different from target" here means the study was too small to tell, not that A is on target. The last row is the one for a planning meeting: confirming a gap this size needs about twelve times the traffic, which is a sample-size decision to make before the next campaign rather than an argument to have after it.

🐍

The full project, step by step

The companion notebook works both questions end to end: it cleans the visitor log with a printed audit trail, checks the successes-and-failures condition for each campaign, runs the one-sample z-test against the target with a Wilson confidence interval and confirms it with an exact binomial test, runs the two-sample z-test with a confidence interval for the difference, and computes both the absolute and relative framings of the lift. Every number here comes from its output, with a plain-language note after each result.

📓 View Notebook (code & outputs) ▶ Open in Colab ⬇ View / Download on GitHub
Read the reports & get the data

The dataset (capstone-email-signup-rates.xlsx) holds one row per visitor on the visitors sheet, with duplicates and missing outcomes left in so you can practice the cleaning. Two written reports accompany it: a plain-language brief for a marketing lead, and a technical report with both tests, intervals, the exact-binomial check, and references.

🎓 Key Takeaways

  • A binary outcome averaged over people is a proportion, and proportions have their own standard error and their own tests.
  • One-sample compares a rate to a fixed target (only one quantity is uncertain); two-sample compares two estimated rates (both are).
  • Check successes and failures, at least about 10 of each; below that use the exact binomial test, which here confirmed the approximation.
  • Not significant means inconclusive: A at 7.54% with a CI of 6.3% to 9.0% is neither above nor below its 7% target, and reporting a win would read noise as signal.
  • Report absolute, then translate: +3.87 pp (CI +1.8 to +6.0), about 387 extra signups per 10,000 visitors. The same result framed as "+51%" overstates it.
9

Quiz: Test Yourself

Eight questions on this capstone, from the assumption check to the framing of the lift. Answer them, hit Check Answers, and keep refining until you score 100%. Your progress is saved.