Sub topic 6
Reading the numbers: sample size and uncertainty
This chapter assumes you have run a landing-page test and have two counts: visitors and signups. You should be comfortable with percentages and ratios. It also assumes you wrote a hypothesis with a success threshold before the test started, as covered earlier in this tutorial. Here you learn what a conversion rate can and cannot tell you when the sample is small.
Why one number is not enough
Suppose 18 of 400 visitors joined your waitlist. That is 4.5%. If your threshold was "at least 5%," it is tempting to say you failed. If it was "at least 4%," it is tempting to say you passed.
Both conclusions treat 4.5% as the true conversion rate of your market. It is not. It is the rate in one sample of 400 people. A different 400 people, drawn from the same audience on a different day, would give a different count. The question is how much the rate could move from sample to sample.
The true conversion rate is the rate you would see if you could show the page to everyone in your target segment. You never observe it. You observe a sample and estimate it. The estimate comes with an uncertainty range, and you should report the range, not only the point value.
Sampling noise
Each visitor either signs up or does not. Even if the true rate is exactly 4.5%, the number of signups in 400 visitors will vary. You might see 14 one time and 23 another time without anything about the page or the market changing.
This variation is called sampling noise. Its size depends mostly on the sample size:
- With few visitors, a single extra signup changes the rate a lot. One signup out of 40 visitors moves the rate by 2.5 percentage points.
- With many visitors, one extra signup barely matters. One signup out of 4,000 moves the rate by 0.025 points.
- Noise shrinks roughly with the square root of the sample size. To cut the uncertainty in half, you need about four times as many visitors.
The square-root rule has a practical consequence. Going from 100 to 400 visitors helps a great deal. Going from 4,000 to 4,300 barely helps. Early in a test, more traffic is very valuable. Later it gets expensive for small gains.
Confidence intervals
A confidence interval is a range of plausible values for the true rate, computed from the sample. A 95% interval is built so that, if you repeated the whole experiment many times, about 95% of the intervals would contain the true rate.
Do not read it as "there is a 95% chance the true rate is in this range for this one experiment." The practical reading is simpler. Values inside the interval are consistent with your data. Values far outside it are not.
For conversion rates, use the Wilson interval. The simple textbook formula (the Wald interval) behaves badly when the sample is small or the rate is near 0% or 100%, which is exactly where landing-page tests live. It can even produce negative lower bounds. The Wilson interval stays within 0% to 100% and is more accurate for small counts.
import math
def wilson_interval(successes, n, z=1.96):
if n == 0:
return (0.0, 0.0)
p = successes / n
denom = 1 + z**2 / n
centre = (p + z**2 / (2 * n)) / denom
margin = z * math.sqrt(p * (1 - p) / n + z**2 / (4 * n**2)) / denom
return (centre - margin, centre + margin)
low, high = wilson_interval(18, 400)
print(f"conversion 4.5%, 95% interval {low:.1%} to {high:.1%}")Running this prints an interval of roughly 2.9% to 7.0%. The value z=1.96 selects the 95% level. A larger z gives a wider, more cautious interval.
So 18 signups from 400 visitors is consistent with a true rate anywhere from about 3% to 7%. A 5% threshold sits inside that range. The data cannot tell you whether you passed.
Comparing the interval to your threshold
The pre-set threshold and the interval together give three outcomes. The table assumes your threshold is a minimum acceptable rate.
| Where the interval sits | What it means | What to do |
|---|---|---|
| Entirely above the threshold | Data supports the hypothesis | Move to the next, more expensive test |
| Entirely below the threshold | Data contradicts the hypothesis | Change the idea, the audience, or the promise |
| Straddles the threshold | The test is inconclusive | Collect more data, or accept that you cannot tell |
Most early tests land in the third row. That is not a failure of the method. It tells you the sample was too small for the question you asked. Beginners often resolve it by picking whichever side they prefer. Do not do that. If you decide the result is a pass because the point estimate is above the line, you have discarded the information the interval gave you.
Planning sample size before you start
You can estimate how many visitors you need before spending money on traffic. The interval width for a rate near p is roughly:
2 × 1.96 × √(p × (1 − p) / n)
If you expect about 5% and want the interval to be about ±2 percentage points wide on each side, solve for n:
n ≈ 1.96² × p × (1 − p) / margin²
With p = 0.05 and a margin of 0.02, that is about 3.84 × 0.0475 / 0.0004, or roughly 456 visitors. For a margin of ±1 point, you need about 1,800.
import math
def visitors_needed(expected_rate, margin, z=1.96):
return math.ceil(z**2 * expected_rate * (1 - expected_rate) / margin**2)
print(visitors_needed(0.05, 0.02))
print(visitors_needed(0.05, 0.01))This prints 457 and 1825. Use it to decide whether a test is affordable. If you can only buy 150 visitors, you already know the interval will be wide. You can then choose a threshold that a result can plausibly clear, or pick a cheaper question.
Pick the margin based on the decision. If a 3% rate means "stop" and an 8% rate means "go," a margin of ±2 points is enough to separate them. If 4% means stop and 5% means go, you need far more data, and you should ask whether such a fine distinction matters at this stage.
Edge cases
Zero or very few signups
With 0 signups from 50 visitors, the observed rate is 0%, but the Wilson interval runs from 0% to about 7%. You cannot conclude the true rate is zero. You can conclude that rates much above 7% are unlikely.
Very small samples
With fewer than about 30 visitors, even the Wilson interval is wide enough to be nearly uninformative. Treat results as stories to investigate, not as measurements.
Looking at the data repeatedly
If you check results every day and stop the moment the rate crosses your threshold, you will often stop on a lucky streak. Decide the sample size in advance, as above, and look at the interval once you reach it. Checking progress is fine. Stopping early because the number looks good is not.
Mixed traffic sources
Pooling a newsletter audience that converts at 12% with a paid-ad audience that converts at 2% gives a blended rate that describes neither. The hidden source field in the signup form exists for this reason. Compute a separate interval for each source, and decide which source matches your target segment.
<form action="/signup" method="post">
<label for="email">Email</label>
<input id="email" name="email" type="email" required>
<input type="hidden" name="source" value="newsletter_a">
<button type="submit">Join the waitlist</button>
</form>Splitting by source also shrinks each sample. A test with 400 visitors split four ways leaves about 100 per source, and each interval widens accordingly.
Duplicates and bots
Count unique visitors, and remove repeat signups and obvious bot entries before computing the rate. Inflated counts make the interval look tighter than the real evidence supports.
What the interval does not tell you
A landing-page conversion measures whether a promise attracted an email address. It does not measure willingness to pay, willingness to use the product, or retention. A narrow interval around 6% means you know the signup rate precisely. It does not make the signup rate a better measure of demand.
Keep the two questions separate:
- How precisely do I know the rate? The interval answers this.
- Does the rate mean what I think it means? Test design and traffic quality answer this.
Summary of the working rules
- Report the rate with its interval, not the rate alone.
- Use the Wilson interval for small counts.
- Estimate the visitors you need before you buy traffic.
- Compare the whole interval with the threshold you set before the test.
- Treat an interval that straddles the threshold as inconclusive.
- Compute intervals separately for each traffic source.
- Do not stop the test early because the number looks good.
Exercise
A landing-page test shows 9 signups from 150 visitors. Your pre-set threshold was a minimum of 8%. The 95% Wilson interval is roughly 3.2% to 11%. What do you conclude, and what are two reasonable next steps?
Show answer
The observed rate is 6%, which is below 8%, but the interval (about 3.2% to 11%) contains 8%. The result is inconclusive: the data neither supports nor rejects the hypothesis. Two reasonable next steps: collect more visitors from the same source until the interval is narrow enough to fall on one side of 8% (about 1,000 visitors would give roughly a ±1.5 to 2 point margin around 6 to 8%), or redesign the test, for example by sharpening the promise or the audience, and run it again with the same threshold. Declaring a pass or a fail from the point estimate alone would be wrong.
Exercise
You run a test with 600 visitors: 400 came from a newsletter you wrote and 200 from paid ads. You get 48 signups from the newsletter and 4 from ads. Why is the pooled rate of 8.7% misleading, and what should you do instead?
Show answer
The two sources behave very differently: the newsletter converts at 12% and the ads at 2%. The pooled rate mixes an audience that already trusts you with one that does not, so it describes neither. The ad audience is smaller (200 visitors), so its interval is also wider. Compute a separate Wilson interval for each source and compare each with the threshold. Decide which source best matches your target customer segment, and base the go or no-go decision on that source.