Textbooks/Engineering Research and Experimental Methods/Chapter 6Lite (plain text) version
6Power, pre-registration and reproducibility
Version 1 · Technically checked (automated checks only) · 4 source lessons · 8 practice items
Introduction
Three habits separate studies that can be trusted from studies that just happened to work. Plan the sample size so a real effect would probably be detected. Write the plan down, with a timestamp, before the data exist. And make every result reproducible: seeds, software versions, raw data and every exclusion recorded. This chapter treats all three as engineering, and adds the hardest one: keeping honest records when the result disappoints.
Explanation
This chapter is built from 4 School lessons. Each part below is the lesson's own explanation; open the lesson for its predict-and-discover activities.
6.1 How many runs? Power and sample size
Ten runs felt like plenty. Then a reviewer asks: what was your chance of detecting the effect if it was real?
Power
Power is the probability that your study detects an effect of a given size if it is really there. It rises with the true effect d, the number of runs n and a looser α. 80% is a common target, meaning a 20% chance of missing a real effect of size d.
Where σ and d come from
σ comes from a pilot or previous work. d should be the smallest effect you care about, not the effect you hope for: planning for a large hoped-for effect produces an under-powered study for the effect that matters.
The winner's curse
If power is low, only the studies that happened to overestimate the effect reach significance. So an under-powered study that 'succeeds' usually exaggerates. This is one reason small published studies often shrink on replication.
Derivation: Runs needed for a target margin
For a mean of n runs with SD σ, SE = σ/√n.
The 95% margin of error is E = 1.96 · σ/√n.
Solve for n: √n = 1.96σ/E, so n = (1.96σ/E)².
For a difference of two independent means with n each and the same σ: SE_diff = σ√(2/n).
For 80% power at two-sided α = 0.05 the expected statistic must sit 1.96 + 0.84 standard errors from zero: d·√(n/2) = 2.80.
So n per group = 2 · (2.80/d)² where d = δ/σ. Halving d quadruples n.
Common mix-ups
- A non-significant result from a small study shows there is no effect.
✓ With low power, a real effect is often missed. Report the interval and the power for the effect that matters.
Open the full lesson: How many runs? Power and sample size →
6.2 Pre-registration: write the plan before the data
If you decide how to analyse your data after seeing it, how would you know you had not just found the analysis that agreed with you?
What to record
Question and hypothesis with direction and SESOI; design (conditions, randomisation, seeds); primary metric and how it is computed; sample size and how it was chosen; exclusion rules; the analysis (test, interval, decision rule); and the date. Store it somewhere time-stamped (a public registry, or a committed file in version control).
Confirmatory versus exploratory
Tests in the pre-registration are confirmatory: their error rates mean what they say. Anything else is exploratory: interesting, worth reporting, but a lead for future work, not a finding. Label them separately in the report.
Deviations happen
A simulator crashes, a metric turns out to be ill-defined. Deviating is allowed; hiding it is not. List each deviation, why it happened and whether it was decided before or after seeing outcome data.
Common mix-ups
- Pre-registration stops you exploring your data.
✓ It labels exploration as exploratory. You can still look at everything; you just cannot present a discovery as a prediction.
Open the full lesson: Pre-registration: write the plan before the data →
6.3 Reproducible by design: seeds, versions, data
Six months from now, can you regenerate Figure 3 exactly? Can a stranger? What would they need?
Determinism
A pseudo-random generator produces the same sequence from the same seed. Record the seed for every run, and report results across several seeds so a lucky seed cannot carry the result. Record the commit of your code and pin library versions, because the same seed in a different version can give a different sequence.
Raw data are sacred
Keep raw outputs unedited and separate from processed data. Every exclusion, filter and transformation is done by a script with the reason in a comment. Then anyone can check that processing did not create the result.
One command
The gold standard: one documented command regenerates every figure and table from raw data. Reporting checklists (many venues publish one) ask exactly these questions; scoring yourself before submission finds gaps early.
Common mix-ups
- My results are reproducible because I could rerun them on my laptop.
✓ Reproducible means a stranger with your repository, data and instructions can regenerate them, on their machine.
Open the full lesson: Reproducible by design: seeds, versions, data →
6.4 Honest records: notebooks, fabrication and falsification
One run crashed and one looks 'obviously wrong'. Deleting them would make the graph cleaner. What is the line between cleaning and falsifying?
The research notebook
Dated entries, written at the time: what you planned, what you did, what happened, what went wrong and what you decided. Never rewrite history: add corrections as new entries. In code, an append-only log with seeds and settings is your notebook.
Fabrication and falsification
Fabrication is making up data or results. Falsification is manipulating materials, equipment, processes, data or images, or omitting data, so the record misrepresents the work. Together with plagiarism they are the core forms of research misconduct.
Anomalies
Decide exclusion rules before data (e.g. 'runs where the simulator reports a numerical error'). Apply them by script. Report how many runs were excluded and why, and show results with and without exclusions when it matters. A run that merely disagrees with you is data.
Common mix-ups
- Removing obviously wrong data points is just good cleaning.
✓ Cleaning follows rules fixed in advance and is fully reported. Removing points because they look wrong to you is selective reporting.
Open the full lesson: Honest records: notebooks, fabrication and falsification →
Worked examples
How many runs? Power and sample size: example 1
Pilot SD 0.3 s; you want a 95% margin of 0.1 s on a mean. Runs?
Solution
n = (1.96 × 0.3 / 0.1)² = 5.88² = 34.6, so 35 runs. For a margin of 0.05 s: 138 runs.
Pre-registration: write the plan before the data: example 1
Halfway through, you realise settling time should use a 2% band, not 5%. What now?
Solution
Decide before looking at outcome data if possible. Record the change, its date and reason as a deviation. Report both definitions, label the pre-registered one as primary unless the change was made blind to outcomes, and let readers judge.
Reproducible by design: seeds, versions, data: example 1
x_{k+1} = (5x + 3) mod 16, seed 7. First three values?
Solution
x₁ = (35 + 3) mod 16 = 38 mod 16 = 6. x₂ = (30 + 3) mod 16 = 1. x₃ = (5 + 3) mod 16 = 8. Anyone with the seed and the rule gets 6, 1, 8.
Honest records: notebooks, fabrication and falsification: example 1
Two of 20 runs give errors five times larger than the rest. No rule was pre-stated. What do you do?
Solution
Keep them. Investigate the logs: if a recorded fault explains them, report that, show results with and without, and propose the rule for future studies. Do not silently delete them.
Interactive figures
Interactive figure (online). Description: The power explorer draws two bell curves: the test statistic with no effect, and with the true effect. A red critical line marks significance; the shaded area of the second curve beyond it is the power. Sliders set effect size, runs per group and α; the readout gives power and the runs needed for 80% and 90%.
Interactive figure (online). Description: The reproducibility checklist scorer lists twelve items in five groups (code, randomness, data, reporting, credit), each with a weight. Ticking items raises a score bar; the readout lists what a reviewer could not do because of the missing items.
Laboratory
Everything runs in your browser. No kit, nothing mains-powered. Simulations are simplified educational models.
Equation Lab exploration
Equation Lab: Distributions
Simulate many small studies of a real but modest effect and count how often each one detects it.
Open Equation Lab: Distributions →BUILD level
BUILD: Smart greenhouse, level 5
Write a pre-registration for a greenhouse controller comparison, including the seeds, runs per condition and exclusion rules.
Open BUILD: Smart greenhouse, level 5 →
Guided practice
Answers are checked on the server; wrong answers get a hint and another try. Signed in, solved items also count towards the source lesson.
- Power 0.8 means…
- 80% of runs succeed
- If the effect of the planned size is real, 80% of such studies would detect it
- The hypothesis is 80% likely
- p = 0.8
- Which d should you plan for?
- The largest effect you hope for
- The smallest effect that would matter for the design
- d = 2, to need few runs
- Whatever the last paper reported
- A design needs 20 runs per group for d = 0.9. About how many for d = 0.45? (runs)
- You notice an unexpected pattern not in your plan. How do you report it?
- As a confirmed finding
- As exploratory, to be tested in future work
- Not at all
- As the primary result
- Your simulator version changed mid-study. What is the honest response?
- Ignore it
- Record the deviation, rerun affected runs if possible, and report it
- Delete affected runs quietly
- Change the hypothesis
- Another team reruns your method on new seeds and new routes and gets consistent results. This is…
- Reproduction with your data and code
- Replication
- Plagiarism
- Pre-registration
- A learner runs out of time and writes in five plausible results for runs never done. This is…
- Estimation
- Fabrication
- Exploratory analysis
- Rounding
- Your hypothesis was refuted. What is the right thing to report?
- Nothing
- The refutation, with the data and interval
- A different hypothesis that fits
- Only the positive secondary results
Engineering applications
Avoiding wasted studies
A comparison with eight runs per condition has little chance of detecting a moderate effect. Calculating power first shows whether the study is worth running at that size at all.
Reproducible simulations
A simulation study that records its seeds, model version and parameter files can be rerun by a reviewer in minutes, which turns 'trust me' into 'check me'.
Watch
Optional verified videos. Nothing loads from YouTube until you press play.
- Statistical Power, Clearly Explained!!! (StatQuest with Josh Starmer)
- Registration & Preregistration (Center for Open Science)
- Is there a reproducibility crisis in science? - Matt Anticole (TED-Ed)
- You Should Be Keeping a Research Notebook (JoshTheEngineer)
Chapter summary
- Power is the chance a study detects an effect of a stated size; plan for 0.8 or more.
- Required runs grow as 1/d²: halving the effect size quadruples the sample.
- Pre-register hypotheses, measures, sample size, exclusions and analysis before the data exist.
- Reproducible means the same inputs give the same results; record seeds, versions, raw data and exclusions.
- Never fabricate or omit data; report refuted hypotheses and deviations openly.
Glossary
- Engineering lab notebook
- A lab notebook is a dated, chronological record of what you planned, did, observed and decided, written at the time rather than afterwards.
- Repeated trials
- Repeating a measurement or test several times shows how much results vary and lets you average out random error.
- Outliers and honest data
- An outlier is a reading far from the rest. It may be a genuine effect or a fault; either way it must be investigated and reported, and any exclusion rule decided before seeing the results.
- Hypothesis
- A hypothesis is a specific, testable statement about how one variable affects another, written so that a measurement could show it to be wrong.
Definitions from the Field Guide.
Project: Pre-register a simulated study
Write a dated pre-registration for a comparison in a School simulation: hypothesis, outcome, smallest effect, power calculation, seeds, exclusion rules and analysis. Run it exactly as written and report any deviation in a separate section.
Deliverables
- The dated pre-registration
- The power calculation
- Results with a deviations section, labelled as simulated
Keep your work in your Engineering Journal; it stays private unless you choose to share it.
References
- Jacob Cohen (1988). Statistical Power Analysis for the Behavioral Sciences, 2nd edition. Lawrence Erlbaum Associates.
- Brian A. Nosek et al. (2018). "The Preregistration Revolution". Proceedings of the National Academy of Sciences 115(11), 2600–2606.
- John P. A. Ioannidis (2005). "Why Most Published Research Findings Are False". PLoS Medicine 2(8).
Publication record
- Version
- 1
- Status
- Technically checked (automated checks only)
- Technical review
- Automated checks only, last run 2026-11-29. No human, educator or mentor review is claimed.src/content/textbooks/textbooks.test.ts: schema, every lesson, diagram, practice item, video, Field Guide entry, lab and reference resolves; figure numbers recomputed; no practice answers in client payloads.
- Written by
- Compiled and written by the Tactiverge team with AI assistance, from Tactiverge School lessons that were themselves written with AI assistance.
- Licence
- All rights reserved by the founders unless a licence is approved.
- Corrections
- None recorded yet.Spotted a mistake? Use “Report a problem” on any chapter, or see the corrections page.