@arpeely/sample-size-calculator
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

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

Package Sidebar

Install

npm i @arpeely/sample-size-calculator

Weekly Downloads

273

Version

1.0.3

License

MIT

Unpacked Size

4.9 kB

Total Files

8

Last publish

Collaborators

  • grooveygr
  • id0sch