Statistical Details
Both our Bayesian and our Frequentist engines begin with a similar foundation for estimating experiment effects. We estimate the experiment effect (either the relative lift or the absolute effect), and its standard error. We create decision making tools from those estimates (e.g., frequentist confidence intervals and p-values, or Bayesian credible intervals and risks) to help you make rollout/rollback decisions.
Our estimates compare an experimental variation (henceforth the treatment) to some baseline variation (henceforth control). Define as the population control mean, and define as the population treatment mean.
The absolute treatment effect is .
The relative treatment effect (or lift) is if and is undefined otherwise.
Throughout for any population parameter denote its sample counterpart as . For example, the sample absolute effect is .
Lift (Relative Effects)
By default, we estimate lift (i.e. relative effects or percentage changes) from the control to the treatment variations. No matter which engine we use, the statistics we leverage are
where and are the estimates of our variation means, and are the estimated variances of those means, and and are the sample sizes. The variance is a delta method estimator, as is a ratio.
We cover how we estimate the variation means and their standard errors below, depending on metric type.
Absolute Effects
The math for absolute effects is simpler, as our estimator is no longer a ratio.
Bayesian Engine
Our Bayesian engine synthesizes the above estimates with information external to the experiment to estimate lift. This synthesis combines the experimental data with the prior distribution, which contains information about the treatment effect before the experiment began.
We specify the following prior
This information is represented by the prior mean and the prior variance . The prior mean is your best guess for the treatment effect before the experiment starts. The prior variance determines your confidence in this best guess. A small prior variance corresponds to high confidence, and vice versa. GrowthBook's default prior is an improper prior (i.e., ) that has no impact.
As of GrowthBook 3.0, you can specify a prior that overrides the default. As stated above, the prior distribution represents your knowledge of the treatment effect before the experiment begins. GrowthBook uses priors on lift, as this is often easier to conceptualize (e.g., 95% chance the true lift is between -50% and 50%). This knowledge can be weak or strong, and we outline a few examples below.
- Weak knowledge: suppose you have little information about your treatment effect, and do not have past data about treatment effects or experiments for this metric. Then use a weak prior, with mean 0 and large variance (e.g., or 1).
- Moderate knowledge: perhaps you have run multiple experiments on this metric. Suppose the average lift for these experiments was 0.01, and the variance of lifts was 0.05. Then a prior with mean 0.01 and variance 0.05 can be appropriate. As another example, suppose you believe that your feature impact will be relatively moderate. A prior, our default when proper priors are enabled, encodes the prior belief that 68% of all experiments have a lift between -30% and 30%, and 95% of all experiments have a lift between -60% and 60%.
- Strong knowledge: suppose you ran a similar experiment last year on the same feature, or you ran this experiment last quarter on a different segment, and your treatment effect estimate was 0.02 and its variance was 0.01. Then a prior with mean 0.02 and variance 0.01 can be appropriate.
In summary, picking the right prior can add information to your results. If you use a moderately informative or strongly informative prior, conduct a sensitivity analysis by comparing your results to those using a weak prior, to see how sensitive your results are to prior selection. For any proper prior, the effect of the prior diminishes as the sample size increases.
These priors are normally distributed and our effect estimates above are asymptotically normally distributed via the Central Limit Theorem. Therefore, combining them to compute our posterior beliefs, which will themselves be normally distributed, we get the following mean and variance for our posterior effect estimates:
For relative effects, we simply plug in the values for our prior and the and values from equations (1) and (2).
For absolute effects, we first rescale the prior so that your prior beliefs represent the same amount of uncertainty for both relative and absolute effects. So we recompute your prior as the following:
where is the prior mean and is the prior variance on the absolute scale.
From the posterior, we can compute the following quantities of interest
Chance To Win
Chance to Win is the percentage of the posterior that is greater than 0 in favor of the treatment variation
where is the CDF of the distribution .
Confidence Interval
Our “confidence interval” in the Bayesian engine is an interval from the 2.5th to the 97.5th percentile of the posterior distribution (e.g. and ). We plot the posterior between these two points in the GrowthBook UI.
Frequentist Engine
In our frequentist engine, we directly use , , and their standard errors.
Sequential Testing - if you have sequential testing enabled, we implement Asymptotic Confidence Sequences, which you can read more about in the sequential testing documentation. Enabling sequential testing does not affect the mean , but it inflates the standard error.
p-value
The p-value is the probability of observing the value if the true was zero. We conduct two-tailed tests, so the p-value if
where is the CDF t-distribution with degrees of freedom estimated via the Welch-Satterthwaite approximation. This converges to using the Normal distribution as sample size increases.
Confidence Interval
We return 95% confidence intervals. They are
Estimating variation means
Our estimates of variation means and their variances (, , , and ) are the same for both engines. In the following, we will focus on the control variation for simplicity. The math is the same for the treatment variation.
While there is no difference across engines, there is a difference in our estimates depending on the metric type being analyzed.
Mean metrics
For mean metrics (e.g. the average revenue per user) we use standard sample mean estimators. This is used for:
- Metrics that are of type
revenue
,duration
, andcount
metrics and do not have denominators - or, Fact Metrics of type
mean
In these cases, we have, for both variations
where is the unit in the control variation's total metric value.
Proportion metrics
Proportion metrics (e.g. the % of users who purchased a product) cover the following cases:
- regular Metrics of type
binomial
- Fact Metrics of type
proportion
In these cases, we have
where is either 0 or 1 for a user.
Ratio metrics
Ratio metrics (e.g. the bounce rate for the number of bounced sessions over the number of total session) require a bit more care as the unit of analysis (e.g. the session) is not the same as the unit of randomization (e.g. the user).
Ratio metrics in GrowthBook are:
- regular Metrics with a denominator that is type
revenue
,duration
, andcount
- Fact Metrics of type
ratio
In these cases, we have
where and are the units' values for the numerator and denominator of the metric, and are the estimated sample mean and variance of that metric, and is the estimated covariance of M and D in the control variation.
Quantile metrics
The statistics for quantile metrics are covered more in detail in the Quantile documentation. But in the end we arrive at both a and for the desired quantile and its variance and use those in our lift calculations.