Skip to content

Exploring and confirming

Exploring is how you find ideas. It goes wrong only when you present what you found as what you set out to test. Learn to keep the two apart, in your data and in your wording.

Applied ~12 min8 steps

You will be able to

  • Say why data can't test the idea they suggested
  • Label an analysis as exploratory or confirmatory
  • Split data so that one idea gets a fair test
  • Report an exploratory finding without overclaiming

Read first

01

The biggest of twenty

Predict

Predict first

You compare 20 customer segments on a metric, and in truth none of them differs. You test the segment with the biggest gap. How likely is p≤0.05p \le 0.05? Assume the 20 comparisons are independent.

Make your guess between 0 and 1 chance, then reveal.

Reveal

1−0.9520≈0.641 - 0.95^{20} \approx 0.64. Testing the biggest of 20 is the same as running all 20. The search is part of the procedure, whether or not it's written down.

02

A story told afterwards

Read

HARKingHARKingPresenting a hypothesis that came from the results as if it had been made in advance. means hypothesizing after the results are known, then writing it up as if the hypothesis came first. It reads well, and readers can't see it.

Data can't fairly test an idea they suggested, because they were always going to agree with it. The test passes before it starts. To test the idea, you need data that played no part in suggesting it.

03

Two honest modes

Read

Neither mode is better. You need both, and you need to know which one you're in.

ExploratoryExploratory analysisLooking through data to find ideas, with choices made along the way, so p-values only describe.ConfirmatoryConfirmatory analysisTesting a stated idea with the outcome, analysis and exclusions fixed before the outcome data are seen.
PurposeFind ideas worth testingTest one stated idea
Choices madeAfter seeing dataBefore seeing data
p-valuesDescriptive: error rates aren't controlledMean what they say
You write"We noticed… this needs new data""We tested… and found…"
04

Why long shots mislead

Explore

Ideas that come from exploring are mostly long shots. Set the share of real effects low, then high, and watch what share of significant results are false.

BExplorable · P(H₀ | p < .05)

When p < .05, how likely is it that there was no effect after all?

Of the results with p < .05, what share come from true nulls?

0.50
How sure?
0.20
0.50
30
Simulating…

Commit your prediction above to see the result

Make your prediction first; the figure appears when you commit.

Make your prediction to see the result.

The test has the same error rate in each case. What changes is how many of your ideas were right to start with. So a significant result from a search deserves less belief than the same p-value from a planned test of a well-grounded idea.

05

Split first

Read

If you can't collect new data, split what you have before you look. Explore on one part, and test one idea on the other. This simulation compares two rates: the search on the first half, and the test of its winner on the second.

Python
import numpy as np
from scipy import stats

rng = np.random.default_rng(1)
reps, explore_hits, confirm_hits = 2000, 0, 0
for _ in range(reps):
    # 20 segments, 40 people in each half, no real differences.
    a1, b1 = rng.normal(size=(40, 20)), rng.normal(size=(40, 20))
    a2, b2 = rng.normal(size=(40, 20)), rng.normal(size=(40, 20))
    ps = stats.ttest_ind(a1, b1, axis=0, equal_var=False).pvalue
    best = ps.argmin()  # search only the first half
    explore_hits += ps[best] <= 0.05
    confirm_hits += stats.ttest_ind(a2[:, best], b2[:, best], equal_var=False).pvalue <= 0.05
print(explore_hits / reps, confirm_hits / reps)
R
set.seed(1)
res <- replicate(2000, {
  # 20 segments, 40 people in each half, no real differences.
  a1 <- matrix(rnorm(800), 40); b1 <- matrix(rnorm(800), 40)
  a2 <- matrix(rnorm(800), 40); b2 <- matrix(rnorm(800), 40)
  ps <- sapply(1:20, function(j) t.test(a1[, j], b1[, j])$p.value)
  best <- which.min(ps)  # search only the first half
  c(explore = ps[best] <= 0.05, confirm = t.test(a2[, best], b2[, best])$p.value <= 0.05)
})
rowMeans(res)

The search looks significant most of the time, and the fresh half stays near 5%. A split costs power, so it's for ideas, not for the final word.

06

Which mode is this?

Checkpoint

Check yourself

An A/B test plan names conversion as the primary metric. After the test, you check eight segments and find that new users respond most. How should you report the new-user result?

Show the answer

Answer: b

Randomization protects the comparison, not the search. Report it, say how many segments you looked at, and test new users on their own next time.

Check yourself

What makes an analysis confirmatory?

Show the answer

Answer: c

Confirmatory describes the order of events. None of the other three tells you when the choices were made.

Check yourself

Which sentence reports an unplanned finding honestly?

Show the answer

Answer: c

It says what was done, how many places were searched, and what the finding is worth.

07

Mark it in the record

In the app

In Insights, More checks has a Quick run: it isn't saved or counted, so use it to find leads. To keep a check, open it in Analyze, and it joins the record.

Now open Multiple testing in the Analyze rail, then the dataset's family. Each test has an Exploratory switch. Turn it on for a look you didn't plan, and the analysis's tests carry an "exploratory" label in the ledger.

08

Recap

Recap
  • Data can't fairly test an idea they suggested. You need new data, or a part you set aside first.
  • Exploring and confirming are both honest. Passing one off as the other isn't.
  • Label exploratory results, say how many places you looked, and treat them as leads.

Concepts in this lesson