NewThe ManyPI MCP Server is now live

Design and judge an A/B test of subject lines

A 90-minute lesson on testing two email subject lines fairly: one variable, a random split, a sample size decided in advance, and a two-proportion z-test worked by hand. Learners see why 8 against 10 replies proves little.

Lesson plan1 h 30 minBachelor +2CC BY 4.0

What you will learn

  • Design a fair A/B test with one variable and a random split
  • Explain why small differences between small groups often come from chance
  • Calculate a two-proportion z-test by hand and read the result
  • Make and justify a decision from a test result
  • Explain why replies are a better test metric than opens

Before you start: Percentages and square roots on a calculator. No earlier statistics needed; the bachelor extension uses the normal distribution.

Overview

A sales team sends the same email with two subject lines. Subject line A gets 8 replies, subject line B gets 10. Is B better? Most people say yes. This lesson shows why the honest answer is "we do not know yet", and what a test needs to give a real answer. All companies and figures are invented.

Running the lesson

90 min
  1. 10 min

    Hook: show the 8 against 10 result. Class vote: is B better? Collect the reasons on the board.

  2. 15 min

    Simulation in pairs: two identical subject lines, same reply chance, 200 emails each. Collect every pair's result on the board.

  3. 15 min

    Input: the rules of a fair test and the sample size table.

  4. 10 min

    Design task: groups plan a test for Fourth Coffee on the planning sheet.

  5. 20 min

    Worked example on the board: the two-proportion z-test, first for 8 against 10, then for 40 against 62.

  6. 15 min

    Practice: groups calculate cases C and D and write down a decision for each.

  7. 5 min

    Exit question: what do you tell a manager who wants to switch to B after 8 against 10 replies?

Materials

  • Board or projector, and calculators with a square root key.

  • A spreadsheet program for the simulation (any will do), one device per pair.

  • The planning sheet and the practice cases below, printed or projected.

  • Optional for homework: the outreach campaign dataset.

Step by step

1. Hook (10 minutes)

Write on the board: "Subject line A: 200 emails, 8 replies. Subject line B: 200 emails, 10 replies." Ask for a vote and for reasons. Typical answers are "B is 25 percent better" (10 is 25 percent more than 8) or "B has a 5 percent reply rate, A only 4 percent". Leave the answers on the board; you come back to them at the end.

2. Simulation (15 minutes)

Pairs build two columns of 200 cells. Every cell is one email that gets a reply with a chance of 5 percent, in both columns. So A and B are, by design, exactly as good as each other.

Spreadsheet formulas for the simulation
A1:  =IF(RAND()<0.05,1,0)     copy down to A200
B1:  =IF(RAND()<0.05,1,0)     copy down to B200
D1:  =SUM(A1:A200)            replies for A
D2:  =SUM(B1:B200)            replies for B

Each pair recalculates five times (F9 in most programs, or edit any empty cell) and notes the two numbers each time. Collect all results on the board.

What the class will see: results anywhere from about 4 to 16 replies, and big differences between two identical subject lines. Mathematically, in about 73 runs out of 100 the two columns differ by 2 or more replies, and in about 42 out of 100 by 4 or more. A gap of 8 against 10 is completely normal for two subject lines that are equally good.

3. The rules of a fair test (15 minutes)

  1. One variable. Change only the subject line. Same text, same sender, same day, same list.

  2. Random split. Give each contact A or B by chance, for example with a random number column that you sort by. Never split by alphabet, region or "the first 500", because those groups can differ in other ways.

  3. Same time. Send both versions in the same time window, so the weekday or a holiday cannot explain the difference.

  4. Decide the metric first. Use replies or positive replies. Opens are unreliable: some mail apps load tracking images automatically and others block them.

  5. Decide the size and the end first. Fix how many emails and when you will look at the result. Checking every hour and stopping as soon as one version is ahead ("peeking") makes chance winners much more likely.

  6. Write the hypothesis down, for example: "A subject line with the customer's company name gets more replies than a generic one."

How big does a test need to be? The table gives rough sizes per variant for a fair chance (80 percent) of detecting a real difference at the usual 5 percent significance level. It is calculated with the standard formula for two proportions.

Reply rate of A

Reply rate of B

Emails needed per variant (about)

4 percent

5 percent

6,700

4 percent

6 percent

1,900

4 percent

8 percent

550

5 percent

10 percent

440

The message for learners: small improvements need very large tests. A team with a list of 400 contacts can only detect big differences, so it should test bold changes, not one word.

4. Design task (10 minutes)

Fourth Coffee, a fictional coffee roaster, sends a monthly email to the 1,200 offices that already buy from it and asks whether they want to try a new blend. Groups fill in the planning sheet.

Question

Your answer

Hypothesis

The one thing that changes

What stays the same

Metric that decides

How contacts are split

Emails per variant

When you look at the result

Decision rule

5. Worked example: the two-proportion z-test (20 minutes)

The z-test asks: if A and B were really equally good, how unusual would the difference we saw be? The steps:

  1. Reply rate of each variant: pA = replies A ÷ emails A, and pB = replies B ÷ emails B.

  2. Pooled rate, as if there were one big group: p = (replies A + replies B) ÷ (emails A + emails B).

  3. Standard error: SE = √( p × (1 − p) × (1 ÷ emails A + 1 ÷ emails B) ).

  4. z = (pB − pA) ÷ SE.

  5. If z is 1.96 or more (or −1.96 or less), the difference is called significant at the 5 percent level. Otherwise it could easily be chance.

Example 1: 8 against 10 replies, 200 emails each.

  • pA = 8 ÷ 200 = 0.04 and pB = 10 ÷ 200 = 0.05.

  • p = 18 ÷ 400 = 0.045, so p × (1 − p) = 0.045 × 0.955 = 0.042975.

  • 1 ÷ 200 + 1 ÷ 200 = 0.01, so SE = √(0.042975 × 0.01) = √0.00042975 = 0.0207.

  • z = (0.05 − 0.04) ÷ 0.0207 = 0.48.

0.48 is far below 1.96. A difference this large or larger would turn up in about 63 out of 100 tests even if both subject lines were equally good. Decision: no evidence that B is better. Keep either one, or run a much bigger test.

Example 2: 40 against 62 replies, 1,000 emails each.

  • pA = 40 ÷ 1,000 = 0.04 and pB = 62 ÷ 1,000 = 0.062.

  • p = 102 ÷ 2,000 = 0.051, so p × (1 − p) = 0.051 × 0.949 = 0.048399.

  • 1 ÷ 1,000 + 1 ÷ 1,000 = 0.002, so SE = √(0.048399 × 0.002) = √0.000096798 = 0.00984.

  • z = (0.062 − 0.04) ÷ 0.00984 = 2.24.

2.24 is above 1.96: significant at the 5 percent level. Decision: use B from now on, and check that the extra replies are not mostly negative ones. Significant does not mean certain: when there is no real difference, about 1 test in 20 still crosses the line by chance.

6. Practice (15 minutes)

Groups calculate z for both cases and write one sentence with their decision.

Case

Variant A

Variant B

C: Contoso

600 emails, 30 replies

600 emails, 48 replies

D: Litware

150 emails, 12 replies

150 emails, 21 replies

Solutions to the practice cases

Case C: Contoso. pA = 30 ÷ 600 = 0.05, pB = 48 ÷ 600 = 0.08. Pooled p = 78 ÷ 1,200 = 0.065, so p × (1 − p) = 0.060775. 1 ÷ 600 + 1 ÷ 600 = 0.003333. SE = √(0.060775 × 0.003333) = √0.00020258 = 0.01423. z = 0.03 ÷ 0.01423 = 2.11. Significant at the 5 percent level: Contoso can switch to B.

Case D: Litware. pA = 12 ÷ 150 = 0.08, pB = 21 ÷ 150 = 0.14. Pooled p = 33 ÷ 300 = 0.11, so p × (1 − p) = 0.0979. 1 ÷ 150 + 1 ÷ 150 = 0.013333. SE = √(0.0979 × 0.013333) = √0.0013053 = 0.03613. z = 0.06 ÷ 0.03613 = 1.66. Not significant at the 5 percent level.

The point to discuss: Litware's gap (6 percentage points) is bigger than Contoso's (3 points), yet only Contoso's result is significant. Small groups need much bigger differences before chance can be ruled out.

To check results quickly in a spreadsheet, with replies A in A2, emails A in B2, replies B in C2 and emails B in D2:

z in one formula
=(C2/D2-A2/B2)/SQRT((A2+C2)/(B2+D2)*(1-(A2+C2)/(B2+D2))*(1/B2+1/D2))

7. Exit question (5 minutes)

Go back to the votes from the start. Each learner writes two sentences to a manager who wants to switch to B after 8 against 10 replies.

Model answer for the exit question

"The difference between 8 and 10 replies is well within what chance produces when two subject lines are equally good; the z-value is only 0.48. If we want to know, we need to plan a larger test of about 1,900 emails per subject line, or test a much bolder change."

Differentiation

  • Easier: skip the formula. Learners compare the real result with the spread they saw in the simulation: "Would this gap have surprised us when A and B were identical?" Give them the spreadsheet formula to calculate z instead of doing it by hand.

  • Harder: turn z into a p-value with a normal distribution table or =2*(1-NORM.S.DIST(ABS(z),TRUE)). Discuss multiple testing: a team that tests 10 subject lines against each other, none better than the others, has a 1 − 0.95¹⁰ = 40 percent chance of at least one false "winner". Discuss why the z-test is only an approximation when there are very few replies.

Homework

  1. Write a complete test plan (the planning sheet) for a subject line test of your own choice, with a list of 600 contacts. Which size of difference can you realistically detect?

  2. In the outreach campaign dataset, 5 of the 45 contacts who got subject line A replied, and 8 of the 45 who got B. Calculate z and write down your decision.

Solutions to the homework
  1. With 600 contacts, 300 per variant: from the table, only large differences such as 5 against 10 percent (about 440 per variant needed) can be detected with a fair chance. A good plan therefore tests a bold change, uses replies as the metric and fixes the end date in advance.

  2. pA = 5 ÷ 45 = 0.1111, pB = 8 ÷ 45 = 0.1778. Pooled p = 13 ÷ 90 = 0.1444, so p × (1 − p) = 0.1236. 1 ÷ 45 + 1 ÷ 45 = 0.04444. SE = √(0.1236 × 0.04444) = 0.0741. z = 0.0667 ÷ 0.0741 = 0.90. Not significant: B looks better, but the sample is far too small to tell. B also got more negative replies than A, which is worth a second look.

Model answer for the Fourth Coffee planning sheet
  • Hypothesis: a subject line that names the new blend ("Try our new Andes blend in your office") gets more replies than a general one ("News from Fourth Coffee").

  • Changes: only the subject line. Stays the same: text, sender, sending day and time, list.

  • Metric: replies asking for a sample (positive replies), not opens.

  • Split: random number next to each of the 1,200 offices, sort by it, first 600 get A, the rest B.

  • Emails per variant: 600. The team knows this will only show a big difference.

  • When to look: once, one week after sending.

  • Decision rule: switch to B if z is 1.96 or more; otherwise keep A and plan a bolder test next month.

Reuse this material

CC BY 4.0

You may copy, adapt and share it, also commercially, as long as you credit ManyPI and link back.

"Design and judge an A/B test of subject lines" by ManyPI (https://manypi.com/edu/ab-test-subject-lines-lesson), licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)