@arpeely/sample-size-calculator
v1.0.3
Published
A/B test sample size calculator which uses a two-tailed sequential likelihood ratio test with false discovery rate controls to calculate statistical significance.
Downloads
704
Readme
A/B test sample size calculator which uses a two-tailed sequential likelihood ratio test with false discovery rate controls to calculate statistical significance.
Credits
This package is inspired by the great work done by Optimizely's Stats Engine.
For the original online version click here
Install
sample-size-calculator is available as an npm package.
#with yarn
yarn add @arpeely/sample-size-calculator
#with npm
npm install @arpeely/sample-size-calculator
Usage
import sampleSizeEstimate from '@arpeely/sample-size-calculator'
// The minimum relative change in conversion rate you would like to be able to detect.
const relativeMDE = 0.3 // 30%
// Your control group's expected conversion rate
const baselineConversionRate = 0.3572 // 35.72%
// Sample size per variation
const sampleSize = sampleSizeEstimate(relativeMDE, baselineConversionRate)
console.log(sampleSize) // output: 160