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.
What runs in CodeSplash
- A/B test analysis — SRM check, lifts, CUPED, guardrails and a Bayesian view Verified in Python and R
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
What does it stop?
PredictPredict first
You write your plan down and timestamp it before any data arrive. Which of these does that actually stop?
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.
What a plan says
ReadA plan answers the questions you'd otherwise answer after seeing the data:
- Hypothesis: what changes, and what you expect
- Primary outcome: one, with its exact definition
- Design and sample size: with the reasoning behind them
- Stopping rule: when you stop, and any planned looks
- Exclusions: which rows go, and by what rule
- Analysis: the test, its options, and how you'll handle missing data
- Decision: what result would change what you do
Each line closes a fork from the garden.
Specific enough?
CheckpointCheck 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.
Freeze it in the studio
In the appOpen 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.
When the plan has to change
PredictPredict 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?
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.
Beyond A/B tests
ReadPre-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.
Write yours
ReflectTake 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.
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())library(digest)
plan <- "Primary outcome: revenue per user. Welch t, two-sided, alpha .05. n = 800 per arm."
digest(plan, algo = "sha256", serialize = FALSE)Check your understanding
CheckpointCheck 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.
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