Skip to content

debitoor/ab-test-result

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ab-test-result

npm version Build Status Dependency Status devDependency Status Coverage Status

Returns the improvement rate of your AB-test (challengerImprovement) and answers if it's statistically significant (isSignificant).

The result returned also contains a statistics property with calculated statistical values.

npm install --save ab-test-result

Usage

	var abTestResult = require('ab-test-result');

	var test = {
		controlVisits: 490, // required
		controlConversions: 10, // required
		challengerVisits: 500, // required
		challengerConversions: 17 // required
	};
	var confidence = 0.9; // optional, defaults to 0.95

	var result = abTestResult.calcResult(test, confidence);
	/*
		result = {
			controlConversionRate: 0.02040816326530612,
			challengerConversionRate: 0.034,
			challengerImprovement: 0.666,
			isSignificant: true,
			statistics: {
				controlStandardError: 0.006387435072946544,
				challengerStandardError: 0.008104813384649889,
				zScore: 1.317131652811523,
				pValue: 0.09340000000000004
			}
		}
	*/

License

MIT