Packs / data-science-public
ab-test-significance
decide if an A/B test result is significant with a two-proportion z-test and a confidence interval
Install
logicpacks pack use data-science-public/ab-test-significanceget_pack data-science-public/ab-test-significanceThe second line is the MCP tool call for the LogicPacks connector (Claude Code, Codex, Claude.ai and others). The first run of a pack someone else wrote asks for your yes.
Keys it needs (names only)
None.
Playbooks included
- Spec:
spec/SPEC.md(goal, steps, edge cases, don’ts) - Routes:
python-stdlib - Checks: 2 in
outcome/checks.yaml - Code:
abtest.py - Tools: python3
Usage, last 8 weeks
New: no recorded use yet.
Purpose (from spec/SPEC.md)
Goal
Decide if an A/B test result is significant with a two-proportion z-test and a confidence interval.
Steps
- Fix the sample size and the metric before the test starts.
- When the test ends, run abtest.py with the counts.
- Report lift with its CI, not just 'significant'.
Edge cases
- Peeking repeatedly inflates false positives; use a fixed horizon.
- Small counts (<10 conversions per arm) make the normal approximation poor.
Don'ts
- Don't stop the test the moment p < 0.05.
Routes (free first)
python-stdlib:code/abtest.py(no install).