Saying the uncertainty out loud
Turn an interval into words a reader will keep, check whether it changes the decision, give probability words a number, and label what a chart's bars show.
What runs in CodeSplash
- A/B test analysis — SRM check, lifts, CUPED, guardrails and a Bayesian view Verified in Python and R
- Two-sample t-test (Welch / Student, or z test) Verified in Python and R
You will be able to
- Write an interval in plain words without turning it into a probability
- Test whether the uncertainty changes the decision
- Use numbers with probability words, and label uncertainty on a chart
A single number makes a promise
Read"The new checkout lifted conversion by 15.2%." Your reader will remember that number, and treat it as what they'll get.
The data allow much more: anything from −3.9% to 34.2% is compatible with them. That range includes a small loss.
The interval is part of the finding. If it's gone from your sentence, the sentence claims more than you know.
What does the interval say?
PredictPredict first
Which sentence about a 95% confidence interval can you stand behind?
Reveal
The second. The 95% belongs to the method over many studies. Once you have one interval, the frequentist framing gives no probability for it. A credible interval from a Bayesian analysis does support the first wording, given its prior. The third confuses an interval for an average with the spread of individuals.
Words that work
Read| Instead of | Write |
|---|---|
| The lift is X | Our best estimate is X, and the data are compatible with anything from L to U |
| There's a 95% chance it's between L and U | The 95% CI runs from L to U |
| We're sure it's positive | The whole interval is above zero |
| A margin of error of M | ± M at 95% confidence (always give the level) |
Say the interval in the units of the decision, such as orders a week or dollars, wherever you can.
Read both ends
ReflectAn interval is two scenarios. Ask what you'd do at each end.
- Low end, −3.9%: conversion falls a little. Would you still want the new page?
- High end, 34.2%: a large gain. What would you regret missing?
If the decision is the same at both ends, the uncertainty doesn't matter, so say so and move on. If the decision flips, that flip is your message. Which is it here, if the new page costs little to keep?
What would narrow it?
ExploreA reader's next question is often "how do we get a firmer answer?" Change n per group and watch the interval.
BExplorable · How wide is an effect size's interval?
How many observations does it take to pin down an effect size?
How many per group for an interval this narrow?
Confidence
The dot is your study: d = 0.50, interval [−0.06, 1.06]. Intervals use the large-sample standard error √(2/n + d²/4n).
Commit your prediction above to see the result
Make your prediction to see the result.
Double the sample and the interval doesn't halve. Cutting its width in half takes about four times the data. That's worth saying out loud when someone asks for "a bit more certainty", because it tells them what it costs.
"Likely" means what?
PredictPredict first
You write, "The new page will likely do better." What chance do your readers take that to mean?
Reveal
Very different ones. Studies since the 1960s find wide disagreement over words such as "likely", "probably" and "possible", even among colleagues. Keep the word if it helps, and put the number beside it.
When you do have a probability
ReadThis test's summary also gives a 95.3% probability that the new page beats the control. Unlike a p-value, that's a statement about the page, given a prior.
Say the whole thing. "Better" here means better by any amount, however small, so give the size alongside it.
Don't line it up against p = .093 as though they measure the same thing. If they seem to disagree, it's because they answer different questions.
Label it on a chart
In the appOpen these in Charts. A point-range chart shows each estimate with its interval. A fan chart shows how a forecast's uncertainty widens with the horizon.
View data
| reaction_ms | condition |
|---|---|
| 357 | Baseline |
| 256 | Baseline |
| 335 | Baseline |
| 374 | Baseline |
| 290 | Baseline |
| 375 | Baseline |
| 363 | Baseline |
| 269 | Baseline |
| 249 | Baseline |
| 322 | Baseline |
| 371 | Baseline |
| 388 | Baseline |
| 271 | Baseline |
| 293 | Baseline |
| 386 | Baseline |
| 327 | Baseline |
| 318 | Baseline |
| 327 | Baseline |
| 341 | Baseline |
| 357 | Baseline |
| 371 | Baseline |
| 320 | Baseline |
| 358 | Baseline |
| 286 | Baseline |
| 313 | Baseline |
| 301 | Baseline |
| 279 | Baseline |
| 313 | Baseline |
| 299 | Baseline |
| 299 | Baseline |
| 287 | Baseline |
| 276 | Baseline |
| 375 | Baseline |
| 339 | Baseline |
| 294 | Baseline |
| 316 | Baseline |
| 293 | Baseline |
| 252 | Baseline |
| 414 | Baseline |
| 263 | Baseline |
| 224 | Baseline |
| 317 | Baseline |
| 312 | Baseline |
| 324 | Baseline |
| 321 | Baseline |
| 287 | Baseline |
| 350 | Baseline |
| 296 | Baseline |
| 289 | Caffeine |
| 313 | Caffeine |
| 361 | Caffeine |
| 312 | Caffeine |
| 198 | Caffeine |
| 284 | Caffeine |
| 339 | Caffeine |
| 281 | Caffeine |
| 302 | Caffeine |
| 394 | Caffeine |
| 324 | Caffeine |
| 336 | Caffeine |
First 60 of 209 rows.
View data
| month | passengers (thousands) | kind | lo 80 | hi 80 | lo 95 | hi 95 |
|---|---|---|---|---|---|---|
| −662,688,000,000 | 110 | actual | — | — | — | — |
| −660,009,600,000 | 105 | actual | — | — | — | — |
| −657,590,400,000 | 120 | actual | — | — | — | — |
| −654,912,000,000 | 135 | actual | — | — | — | — |
| −652,320,000,000 | 136 | actual | — | — | — | — |
| −649,641,600,000 | 153 | actual | — | — | — | — |
| −647,049,600,000 | 154 | actual | — | — | — | — |
| −644,371,200,000 | 140 | actual | — | — | — | — |
| −641,692,800,000 | 131 | actual | — | — | — | — |
| −639,100,800,000 | 131 | actual | — | — | — | — |
| −636,422,400,000 | 129 | actual | — | — | — | — |
| −633,830,400,000 | 126 | actual | — | — | — | — |
| −631,152,000,000 | 116 | actual | — | — | — | — |
| −628,473,600,000 | 122 | actual | — | — | — | — |
| −626,054,400,000 | 141 | actual | — | — | — | — |
| −623,376,000,000 | 146 | actual | — | — | — | — |
| −620,784,000,000 | 157 | actual | — | — | — | — |
| −618,105,600,000 | 166 | actual | — | — | — | — |
| −615,513,600,000 | 171 | actual | — | — | — | — |
| −612,835,200,000 | 170 | actual | — | — | — | — |
| −610,156,800,000 | 163 | actual | — | — | — | — |
| −607,564,800,000 | 147 | actual | — | — | — | — |
| −604,886,400,000 | 144 | actual | — | — | — | — |
| −602,294,400,000 | 131 | actual | — | — | — | — |
| −599,616,000,000 | 135 | actual | — | — | — | — |
| −596,937,600,000 | 139 | actual | — | — | — | — |
| −594,518,400,000 | 146 | actual | — | — | — | — |
| −591,840,000,000 | 163 | actual | — | — | — | — |
| −589,248,000,000 | 174 | actual | — | — | — | — |
| −586,569,600,000 | 183 | actual | — | — | — | — |
| −583,977,600,000 | 185 | actual | — | — | — | — |
| −581,299,200,000 | 179 | actual | — | — | — | — |
| −578,620,800,000 | 185 | actual | — | — | — | — |
| −576,028,800,000 | 169 | actual | — | — | — | — |
| −573,350,400,000 | 154 | actual | — | — | — | — |
| −570,758,400,000 | 152 | actual | — | — | — | — |
| −568,080,000,000 | 149 | actual | — | — | — | — |
| −565,401,600,000 | 151 | actual | — | — | — | — |
| −562,896,000,000 | 184 | actual | — | — | — | — |
| −560,217,600,000 | 177 | actual | — | — | — | — |
| −557,625,600,000 | 185 | actual | — | — | — | — |
| −554,947,200,000 | 210 | actual | — | — | — | — |
| −552,355,200,000 | 212 | actual | — | — | — | — |
| −549,676,800,000 | 210 | actual | — | — | — | — |
| −546,998,400,000 | 199 | actual | — | — | — | — |
| −544,406,400,000 | 182 | actual | — | — | — | — |
| −541,728,000,000 | 181 | actual | — | — | — | — |
| −539,136,000,000 | 168 | actual | — | — | — | — |
| −536,457,600,000 | 171 | actual | — | — | — | — |
| −533,779,200,000 | 181 | actual | — | — | — | — |
| −531,360,000,000 | 202 | actual | — | — | — | — |
| −528,681,600,000 | 211 | actual | — | — | — | — |
| −526,089,600,000 | 208 | actual | — | — | — | — |
| −523,411,200,000 | 234 | actual | — | — | — | — |
| −520,819,200,000 | 249 | actual | — | — | — | — |
| −518,140,800,000 | 233 | actual | — | — | — | — |
| −515,462,400,000 | 225 | actual | — | — | — | — |
| −512,870,400,000 | 228 | actual | — | — | — | — |
| −510,192,000,000 | 204 | actual | — | — | — | — |
| −507,600,000,000 | 199 | actual | — | — | — | — |
First 60 of 156 rows.
Send one to a report, and write in its Note what the bars or bands show and at what level. Without that, the same marks could mean an SD, an SE or a CI.
Get the interval in code
ExploreDon't stop at printing the numbers. Write the sentence the reader needs.
import pandas as pd
from scipy import stats
df = pd.read_csv("toothgrowth.csv")
oj = df.loc[df["supp"] == "OJ", "len"]
vc = df.loc[df["supp"] == "VC", "len"]
res = stats.ttest_ind(oj, vc, equal_var=False)
ci = res.confidence_interval(0.95)
diff = oj.mean() - vc.mean()
print(f"Best estimate {diff:.1f}; compatible with {ci.low:.1f} to {ci.high:.1f} (95% CI).")df <- read.csv("toothgrowth.csv")
res <- t.test(len ~ supp, data = df)
ci <- res$conf.int
diff <- unname(res$estimate[1] - res$estimate[2])
sprintf("Best estimate %.1f; compatible with %.1f to %.1f (95%% CI).", diff, ci[1], ci[2])The same interval is on the t test's card: −0.2 to 7.6.
Check your understanding
CheckpointCheck yourself
A 95% CI for a price effect is [−2, 8] dollars. Which sentence is best?
Show the answer
Answer: c
It gives the estimate and the range, in the reader's units, and it doesn't turn the interval into a probability about this one result.
Check yourself
The whole interval for a change's profit is positive, and you'd make the change at either end. What should your summary do?
Show the answer
Answer: a
Uncertainty deserves words in proportion to how much it affects the decision. Here it doesn't, so tell the reader that, and keep the range for those who want it.
Check yourself
To cut a confidence interval's width in half, about how many times the data do you need?
Show the answer
Answer: 4
Width shrinks with , so halving the width takes times the data.
Check yourself
What's the most reliable way to use a word such as "probably"?
Show the answer
Answer: b
The word helps the sentence, and the number tells every reader the same thing.
The last thing you said
ReflectRecall the last time someone asked "So, did it work?" What did you tell them? How would you answer now, with both ends of the interval in one sentence?
Recap
Recap- Say the estimate and the range, without turning a confidence interval into a probability.
- Read both ends: does the decision change? If it does, that's your message.
- Give probability words a number, and label what a chart's bars or bands show.
Concepts in this lesson