Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chi-square-a-b-testing

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chi-square-a-b-testing

Npm module for calculating chi-square test that gives us p-value for statistical significance with practical use in A/B testing.

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.8K
decreased by-5.18%
Maintainers
1
Weekly downloads
 
Created
Source

Statistical significance for A/B testing (using chi-square)

Npm module for calculating chi-square test that gives us p-value for statistical significance with practical use in A/B testing.

Installation

`npm install --save-dev chi-square-a-b-testing`

Usage

Let's consider we have two ad variations - each variation has been displayed 50 times. The first ad was clicked 1, whereas the second ad was clicked 5 times. Is the difference statistically significant? Let's find out using chi-square test

* * * * * * * * * * *
* SAMPLE | CLICKED  *
* 50     | 1        * - ad variation 1
* 50     | 5        * - ad variation 2
* * * * * * * * * * *
var test = require('chi-square-a-b-testing');

// Set up our sample values
const table = [
    [50, 1],
    [50, 5]
];

// Calculate the p-value
let pValue = test(table); // 0.9078770365273039

In this case the pValue = 0.9078770365273039, which means we cannot consider the difference between those two variations statistically significant if we set our threshold to 0.5 (which is usually the case for a standard experiment).

Acknowledgement

The JavaScript implementation of chi-square test was done by http://stats.theinfo.org/ (Aaron Swartz and Ben Wikler)

Keywords

FAQs

Package last updated on 27 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc