Skip to content

Pre-registration

Write the plan down before the data arrive, so later you and your readers can tell what was planned from what was found. Learn what a good plan says, and how to change it honestly.

Applied ~12 min9 steps

What runs in CodeSplash

You will be able to

  • Say what pre-registration does and doesn't forbid
  • Write a plan specific enough to close the forks
  • Pre-register an experiment in CodeSplash and record an amendment

Read first

01

What does it stop?

Predict

Predict first

You write your plan down and timestamp it before any data arrive. Which of these does that actually stop?

It stops you exploring the dataIt stops you changing the planIt stops you presenting a later choice as if it was planned
Reveal

The third. You can still explore, and you can still change the plan. Pre-registrationPre-registrationA dated record of your hypothesis, outcome, design and analysis, written before the data arrive. only makes the difference visible, to your readers and to you. It helps with memory as much as with honesty, because a month later it's easy to believe you planned what you found.

02

What a plan says

Read

A plan answers the questions you'd otherwise answer after seeing the data:

  1. Hypothesis: what changes, and what you expect
  2. Primary outcome: one, with its exact definition
  3. Design and sample size: with the reasoning behind them
  4. Stopping rule: when you stop, and any planned looks
  5. Exclusions: which rows go, and by what rule
  6. Analysis: the test, its options, and how you'll handle missing data
  7. Decision: what result would change what you do

Each line closes a fork from the garden.

03

Specific enough?

Checkpoint

Check yourself

Which plan entry actually closes a fork?

Show the answer

Answer: c

A good test: could a stranger run your plan and get your number? The other three leave the choice open until the data are in.

Check yourself · choose all that apply

Which of these belong in the plan? Choose all that apply.

Show the answer

Answer: a, b, c, e

Everything that could be steered by the result belongs there. The result belongs in the report.

04

Freeze it in the studio

In the app

Open A/B tests in Studios, and go to Pre-register. It won't let you freeze until four things are true: the hypothesis says what changes and what you expect; there's one primary metric, at least two arms and a valid effect; the sample size is computed; and any stopping boundaries are computed.

Pre-register then records the plan and its SHA-256 fingerprint. You can export the plan as a Quarto document.

05

When the plan has to change

Predict

Predict first

Two days into a test, before you've seen any outcome data, you find that your guardrail metric is defined wrongly. What do you do?

Keep to the plan, flaws and allChange it, and record the change with the reasonQuietly fix it, since no results are in yet
Reveal

Change it, and record the change with the reason. A plan is a record of what you knew and when, not a vow. Once the frozen plan differs from the design, the studio asks for an amendment: your reason, a timestamp and a new fingerprint. A reader can then judge how much the change matters, and whether it came before or after the data.

06

Beyond A/B tests

Read

Pre-registration began with clinical trials, and it works for any study you can plan. Public registries include ClinicalTrials.gov, OSF and AsPredicted. A Registered Report goes further: a journal reviews the plan and agrees to publish whatever comes out.

Data you've already collected can work too, if you can honestly plan before you look at the outcome. In Analyze, the equivalent is a locked confirmatory family, which the next lesson covers.

07

Write yours

Reflect

Take a question you're about to analyze. Write the seven lines from "What a plan says", in plain sentences, and date them.

Then look for words such as "appropriate", "relevant", "suitable" and "as needed". Each one is a fork you left open. Replace it with a rule, or say honestly that this part is exploratory.

The hash below is what makes a plan tamper-evident: change one character, and the fingerprint changes completely.

Python
import hashlib

plan = "Primary outcome: revenue per user. Welch t, two-sided, alpha .05. n = 800 per arm."
print(hashlib.sha256(plan.encode("utf-8")).hexdigest())
R
library(digest)

plan <- "Primary outcome: revenue per user. Welch t, two-sided, alpha .05. n = 800 per arm."
digest(plan, algo = "sha256", serialize = FALSE)
08

Check your understanding

Checkpoint

Check yourself

After a pre-registered test, you notice an interesting pattern that wasn't in the plan. What should you do?

Show the answer

Answer: c

Exploring after a plan is fine. An amendment after you've seen the outcome can't make a finding confirmatory, because the plan's value comes from having been written first.

Check yourself

What does a pre-registered result guarantee?

Show the answer

Answer: d

A registered plan can still be a bad plan. It protects against one thing, flexibility after the fact, and leaves the rest to you.

09

Recap

Recap
  • Pre-registration separates what you planned from what you found. It doesn't forbid exploring or changing your mind.
  • A plan is good when a stranger could run it and get your number.
  • Change a plan openly, with the reason and the date. Report unplanned findings as exploratory.

Concepts in this lesson