ab-test-sample-size
Required sample size per arm for a two-proportion A/B test, given the expected baseline conversion rate, the minimum detectable effect (relative lift), the significance threshold alpha (default 0.05, two-tailed), and the statistical power (default 0.80).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alpha | No | Significance threshold (default 0.05). Two-tailed. | |
| power | No | Statistical power 1−β (default 0.80). | |
| baseline_rate | Yes | Expected control conversion rate as a proportion in (0, 1). E.g. 0.05 for 5%. | |
| minimum_detectable_effect | Yes | Smallest relative lift you want to detect, as a proportion. 0.10 means 'detect a 10% relative lift over baseline' (so for a 5% baseline, you want to detect a move to 5.5%). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alpha | Yes | Significance threshold used. | |
| power | Yes | Statistical power used. | |
| total | Yes | Total visitors across both arms: 2 × per_arm. | |
| per_arm | Yes | Required visitors per arm (control AND variant each need this many). | |
| target_rate | Yes | Target rate after the minimum detectable lift. | |
| baseline_rate | Yes | Baseline rate used in the calculation. |