Bayesian Experiments

Learn about Bayesian A/B testing on Statsig, including informative priors and implementation details.

Bayesian mode reports each metric as a chance to beat control and an expected loss instead of a p-value, and can combine an informative prior with the observed data. Use it when stakeholders need probability readouts, or when you have reliable priors from past experiments. Experiments use frequentist analysis by default.

Turn on Bayesian mode

To switch an experiment to Bayesian mode, go to the experiment's Setup tab, expand Advanced Settings, and set Analytics Type to Bayesian under Analysis Configuration. You can't change the analytics type after the experiment starts.

Selecting Bayesian reveals Bayesian Mode Settings, where Default Chance to Beat Threshold sets the probability a variant must reach for Statsig to call it a winner.

After the experiment starts, the scorecard on the Results tab shows a credible interval for each metric. To see a metric's chance to beat control and expected loss, select the metric's bar on the scorecard to open its details, then go to the Statistics tab. On the Time Series tab, the Chart Type setting charts Chance To Beat or Expected Loss over time.

Statistics tab of a metric's details, showing units, observed mean, and standard error for each group, and a summary of the metric's lift, chance to beat, and expected loss

Informative priors

In Bayesian mode, you can set a prior belief on the relative average treatment effect. Statsig combines the prior distribution with the observed data and displays the prior-adjusted results. To turn on priors, select Use Informative Priors under Bayesian Mode Settings. Then choose a Metric and enter its Prior Mean and Prior Standard Deviation for Relative Lift, both in percent. To set a prior on another metric, select Add Metric.

Use Informative Priors selected under Bayesian Mode Settings, showing Metric, Prior Mean, and Prior Standard Deviation for Relative Lift fields and an Add Metric button

Deriving a prior from historical data

When you use informative priors, make sure your organization understands how the prior influences the experiment results, and base the prior on domain knowledge. Two common patterns:

  • Use the AVG(average treatment effect)AVG(\text{average treatment effect}) of past experiments with a similar setup and population as the prior mean, and the standard deviation of those effects, or a multiple of it, as the prior standard error.
  • Use the AVG(observed standard error)AVG(\text{observed standard error}) of past experiments as the prior standard error.

How Statsig computes the posterior

Denote N(ATEprior,STEprior2)\mathcal{N}(ATE_{prior}, STE_{prior}^2) as the prior distribution, where ATEpriorATE_{prior} is the average treatment effect and STEpriorSTE_{prior} is the standard error. Denote N(ATEobserved,STEobserved2)\mathcal{N}(ATE_{observed}, STE_{observed}^2) as the observed distribution.

Statsig calculates the posterior distribution as:

ATEpost=ATEpriorSTEprior2+ATEobservedSTEobserved21STEprior2+1STEobserved2ATE_{post} = \frac{ \frac{ATE_{prior}}{STE_{prior}^2} + \frac{ATE_{observed}}{STE_{observed}^2} }{ \frac{1}{STE_{prior}^2} + \frac{1}{STE_{observed}^2} }
STEpost2=11STEprior2+1STEobserved2STE_{post}^2 = \frac{1}{ \frac{1}{STE_{prior}^2} + \frac{1}{STE_{observed}^2} }

If you don't specify a prior, Statsig uses N(0,∞)\mathcal{N}(0, \infty) as the prior distribution N(ATEprior,STEprior2)\mathcal{N}(ATE_{prior}, STE_{prior}^2).

Bayesian statistics glossary

Bayesian A/B tests use different terminology from the frequentist framework.

Was this helpful?

For AI agents: a documentation index is available at /llms.txt. Append .md to any page URL for markdown, or send Accept: text/markdown.

On this page