Frequentist engine details
Frequentist power
Below we describe technical details of our implementation. First we start with the definition of power. Power is the probability of a statistically significant result. We use the terms below throughout. Define:- the false positive rate as (GrowthBook default is ).
- the critical values and where is the inverse CDF of the standard normal distribution.
- the true relative treatment effect as , its estimate as and its estimated standard error as . Note that as the sample size increases, decreases by a factor of .
- equal sample sizes across control and treatment variations. If unequal sample sizes are used in the experiment, use the smaller of the two sample sizes. This will produce conservative power estimates.
- equal variance across control and treatment variations;
- observations across users are independent and identically distributed;
- all metrics have finite variance; and
- you are running a two-sample t-test. If in practice you use CUPED, your power will be higher.
Frequentist minimum detectable effect
Some customers want to know what effect size is required to produce at least power.The minimum detectable effect is the smallest for which nominal power (e.g., 80%) is achieved. Below we describe commonly used MDE calculations, though we do not use these at GrowthBook.
For a 1-sided test there is a closed form solution for the MDE. Solving Equation 1 for produces In the 2-sided case there is no closed form solution.
Often in practice the MDE is defined as the solution to inverting Equation 2.
This ignores the negligible term in Equation 3, and produces power estimates very close to : This approach works when effects are defined on the absolute scale, where the uncertainty of effect estimate does not depend upon the true absolute effect. For relative inference, this does not hold, and so GrowthBook uses a different approach. The terms below are used to help define the variance of the sample lift.
- Define as the absolute effect.
- Define as the population mean of variation and as the population variance.
- For variation analogously define ; recall that we assume equal variance across treatment arms.
- Define as the per-variation sample size.
- Define the sample counterparts as (, , , and ).
To find the MDE we solve for the equation below, where we make explicit the dependence of on : Define the constant . We solve for in: Rearranging terms shows that This is quadratic in and has solution The discriminant reduces to so a solution for exists if and only if Similarly, the MDE returned can be negative if the denominator is negative, which is nonsensical.
We return cases only where the denominator is positive, which occurs if and only if: The condition in Equation 10 is stricter than the condition in Equation 9. In summary, there will be some combinations of where the MDE does not exist for a given . If and , then . Therefore, a rule of thumb is that needs to be roughly 9 times larger than the ratio of the variance to the squared mean to return an MDE. In these cases, needs to be increased.
Sequential testing
To estimate power under sequential testing, we adjust the variance term to account for sequential testing, and then input this adjusted variance into our power formula. We assume that you look at the data only once, so our power estimate below is a lower bound for the actual power under sequential testing. Otherwise we would have to make assumptions about the temporal correlation of the data generating process. In sequential testing we construct confidence intervals as where and is a tuning parameter. This approach relies upon asymptotic normality. For power analysis we rewrite the confidence interval as where . We use power analysis described above, except we substitute for .Bayesian engine details
Bayesian power
For Bayesian power analysis, we let users specify the prior distribution of the treatment effect. We then estimate Bayesian power, which is the probability that the credible interval does not contain 0. We assume a conjugate normal-normal model, as follows: In words, the model has two parts: 1) the normal prior for the treatment effect, which is specified by you; and 2) conditional upon the treatment effect, the estimated effect is normally distributed. The normal prior has several advantages, including: 1) bell-shaped distribution around the prior mean, so that extreme estimates will be shrunk more towards the prior than moderate estimates; 2) the ability to specify two moments, which is often the right amount of information for a prior; and 3) simplicity.The conditional normality of the effect estimate is motivated by the central limit theorem. We use the normal distribution below to approximate the posterior: This is an approximation to the posterior because affects . We tested this approximation through extensive simulations, and found it had comparable coverage and mean squared error to a posterior distribution empirically sampled using Metropolis Hastings. We define rejection as the % confidence interval not containing zero.
For our posterior approximation, this occurs if the posterior mean for (i.e., ) divided by its posterior standard deviation is beyond the the appropriate critical threshold (e.g., for ). Inside of a Bayesian framework, it can help to permit the case where the prior model is misspecified.
That is, the prior specified by the customer differs from the true prior that generates the treatment effect.
We permit misspecification of the prior for , as we assume that the true data generating process (DGP) is , while the specified DGP has . We assume the prior is specified on the relative scale. In derivations below we use the marginal distribution of , which we find using its moment generating function: For a 2-sided test the probability of rejection is In practice GrowthBook assumes there is a true fixed effect size, i.e., the variance of the data generating process equals 0, and , so two-sided power is We assume that for simplicity and because large values of can result in negative MDEs (see here). If the prior variance equals infinity then Equation 11 reduces to Equation 4.
Bayesian minimum detectable effect
MDEs are not well defined in the Bayesian literature. We provide MDEs in Bayesian power analysis for customers that are used to conceptualizing MDEs and want to be able to leverage prior information in their analysis. We could define the MDE as the minimum value of such that at least power is achieved. This definition is Bayesian in that it permits uncertainty in the parameters in the data generating process. However, if is large, then there are some combinations of parameters where the MDE can be negative. That is, negative values of result in power being at least . Usually the inferential focus is the true treatment effect for the experiment (), not the population mean from which is just one realization (), so we set and consequently, . This is why in practice we frame our Bayesian MDE as, “given our prior beliefs and the data generating process, what is the probability we can detect an effect of size ?”, where is a fixed number. Another subtlety is that for a fixed sample size, Equation 11 can be decreasing in effect size, illustrated by Figure 1.
Figure 1
- Define as the length between points at which power is evaluated (l=0.001 in production).
- Define the grid of points between 0 and 5 as
- Begin evaluating for .
- If for all , then the MDE does not exist. Otherwise:
- Find the first such that . Define as a finer grid resolution (in production, ). Find the first element of the set such that power evaluated at that point is at least . If no such point exists, return to the coarser grid search in Step 3.

