S5 study packet

Everything behind the locked S5 result, as one coherent set: the pre-registration, the S5 methodology brief, the frozen data, the fielded instrument, and the analysis code that turns the data into the published numbers.

Start here

The pre-registration and the methodology rationale for the locked wave.

S5 pre-registration
The plain-English pre-registration summary: design, exclusion rules, and what each test means (filed on OSF before analysis).
S5 methodology rationale
Why the S5 study is built the way it is, and how it avoids leading respondents. True for S5; does not borrow S6 design claims.

Data

The frozen responses and the published numbers. These reproduce every figure on the site.

data/rthg-s5-dataset.jsonl
The frozen, de-identified responses, one per line. No Prolific IDs (salted pseudonyms only); raw written answers removed.
918.7 KBDownload
data/rthg-s5.json
The published numbers, the dataset fingerprint (SHA-256), and the freeze date.
100.2 KBDownload
data/rthg-s5-figures.json
The exact figures rendered on the public site.
1.5 KBDownload

Survey instrument

The authoritative wording, item structure, and the S5 exclusion rules as fielded.

lib/rthg-study-definition.ts
Every page, question, scale, and principle id, exactly as fielded, plus the analysis-plan constants.
115.4 KBDownload
lib/rthg-study-flags-s5.ts
The pre-registered S5 exclusion and data-quality flag rules (B-rev excluded at 3 or higher; vote-2024 citizenship proxy).
9.0 KBDownload

Analysis code

The script and engine that turn the raw data into the published numbers. The same code the /verify page runs in your browser.

scripts/rthg-reproduce.ts
Recomputes every published figure from the raw data and prints MATCH or MISMATCH against the published values.
5.6 KBDownload
lib/study-analysis/index.ts
The analysis engine entry point: ties parsing, filtering, and statistics together.
1.7 KBDownload
lib/study-analysis/parse.ts
Normalizes a raw response row into the engine’s internal shape.
3.7 KBDownload
lib/study-analysis/filters.ts
Applies the pre-registered exclusion rules and builds the sample funnel.
2.9 KBDownload
lib/study-analysis/stats.ts
The pure statistics (support shares, Wilson intervals, principle agreement, party breakdown).
9.6 KBDownload
lib/study-analysis/waves.ts
Per-wave field keys and page ids (taken verbatim from the survey instrument).
7.2 KBDownload
lib/study-analysis/types.ts
The data structures used across the analysis engine.
5.2 KBDownload

Unit tests

Every rule in the analysis engine has a unit test. The same tests run inside the /verify page (in your browser) and on the command line. A green suite means the deployed code matches the documented behavior.

lib/study-tests/framework.ts
Tiny framework-agnostic test runner used by both vitest and the in-browser runner.
5.8 KBDownload
lib/study-tests/fixtures.ts
Synthetic clean-baseline row builders for S5, S6, and s6-short. Tests perturb one field at a time to exercise a single rule.
6.0 KBDownload
lib/study-tests/parse.tests.ts
Reads vote, mechanism, panel, and demographics from the right keys per wave; B-rev reverse-scoring; no-opinion handling.
6.1 KBDownload
lib/study-tests/stats.tests.ts
Wilson 95% CI, mean, median, vote stats, principle stats, mechanism, shift, post-stratification.
12.1 KBDownload
lib/study-tests/filters-s5.tests.ts
Every S5 frozen exclusion rule (attention, reverse-coded, comprehension, method, speed, final check, no-opinion).
6.5 KBDownload
lib/study-tests/cell-assignment.tests.ts
Seed determinism, cell assignment, Section B fixed positions, and a 1,000-seed property test of the no-three-in-a-row cluster rule.
7.4 KBDownload
lib/study-tests/waves.tests.ts
Each wave config has the right arm prefix, mechanism rating prefix, panel page reuse, and post-strat benchmark.
3.9 KBDownload
lib/study-tests/cohorts.tests.ts
Cohort funnel narrows monotonically; vote-2024 proxy applies on S5 only; non-citizen flag drops on S6+.
5.3 KBDownload
lib/study-tests/run.ts
Command-line entry that runs every test outside vitest and exits non-zero on failure.
lib/study-tests/__vitest__/all.test.ts
Vitest adapter so the same tests report in a standard test runner.

AI audit prompt

The copy-paste prompt for the no-code AI verification path.

AI_AUDIT_PROMPT.txt
The copy-paste prompt for the no-code AI verification path (S5).
2.4 KBDownload