dataFrame.columns.stat — sampleSize()
Description
The sampleSize() method of the stat object computes the required sample size to detect a Minimum Detectable Effect (MDE) for a given Conversion Rate.
Signature
dataFrame.columns(conversionRate, minimumDetectableEffect).stat.sampleSize()Arguments
conversionRate(string)- The name of the column containing the conversion rate.
minimumDetectableEffect(string)- The name of the column containing the Minimum Detectable Effect (MDE).
Options
power(number)- The desired statistical powerof the test. (Default:
0.8) significance(number)- The significance level of the test. (Default:
0.05) variants(number)- The total number of groups included in the test, including the reference group. (Default:
1)
Returns
mask( number[] )- An array containing the required sample size for each conversion rate.
Example
// calculate the sample size for an A/B test
var mask = dataFrame.columns('Conversion Rate', 'MDE').stat.sampleSize({ variants: 2 });
// add the sample size to the dataFrame
dataFrame.column('Sample Size').set(mask);