Skip to content

arpeely/sample-size-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample Size Calculator

A/B test sample size calculator which uses a two-tailed sequential likelihood ratio test with false discovery rate controls to calculate statistical significance.

npm version code style: prettier volkswagen status

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