'use strict';

/**
 * Internal dependencies
 */
let NormalDistribution = require( './normal-distribution' );

function SampleProportion( participants, conversions ) {
	let mean = conversions / participants,
		sd = Math.sqrt( mean * ( 1 - mean ) / participants );

	NormalDistribution.call( this, mean, sd );
}

SampleProportion.prototype = Object.create( NormalDistribution.prototype );
SampleProportion.prototype.constructor = SampleProportion;

module.exports = SampleProportion;

'use strict';

/**
 * Internal dependencies
 */
let NormalDistribution = require( './normal-distribution' );

class SampleProportion extends NormalDistribution {
	constructor( participants, conversions ) {
		let mean = conversions / participants,
			sd = Math.sqrt( mean * ( 1 - mean ) / participants );

		super( mean, sd );
	}
}

module.exports = SampleProportion;

Convert Sample Proportino class to ES6
Convert Sample Proportino class to ES6
