p-Value Calculation
What p-values mean in Statsig experiments, how they are computed, and how to interpret them alongside confidence intervals and lift estimates.
A p-value tells you how likely your result would be if the treatment had no effect. It's the probability of seeing a difference between test and control at least as large as the one you measured, assuming there's no real difference. That assumption is called the null hypothesis. A small p-value means chance alone is an unlikely explanation for the result.
Statsig marks a metric as statistically significant when its p-value is below the significance level , which is 0.05 by default. To compute the p-value, Statsig compares the mean and variance of each group with a two-sample z-test. When the degrees of freedom are below 100, it uses Welch's t-test instead. If you turn on a correction for multiple comparisons, such as Bonferroni or Benjamini-Hochberg, Statsig accounts for the correction when it decides significance, and the metric's details show an adjusted p-value.
The p-value tells you whether there's an effect; the confidence interval tells you how large it might be. A p-value below usually means the confidence interval excludes zero. Relative deltas are the exception: even when the p-value is significant, the relative interval can cross zero under the Delta Method, or appear as a point estimate under Fieller Intervals.
Two-sample tests
Two-sided z-test
Statsig computes the z-statistic (z-score) of a two-sample z-test. The following forms are equivalent:
where:
- is the observed z-statistic, not the z-critical value .
- is the variance of the absolute delta of means.
- is the variance of the sample mean of the control or treatment group.
- is the standard error of the mean of the control or treatment group. To see these values, click a metric's interval bar on the Results tab and open the Statistics tab. Its Std Err column shows the standard error for each group, and the tab also shows the degrees of freedom.
The two-sided p-value comes from the standard normal cumulative distribution function:
Welch's t-test
For smaller sample sizes, Welch's t-test produces lower false positive rates when group sizes and variances are unequal. On the Results tab, Statsig applies Welch's t-test automatically when the degrees of freedom .
Statsig computes the t-statistic (t-score) with the same formula as the two-sample z-statistic, and the degrees of freedom as:
Statsig then obtains the p-value from the t-distribution with degrees of freedom.
One-sided z-test
For a one-sided z-test, Statsig computes the z-statistic with the same formula as the two-sided test, and takes the p-value from the standard normal cumulative distribution function with these differences:
where is the signed z-statistic, not the absolute value that the two-sided p-value uses. When is below 100, Statsig takes the one-sided p-value from the t-distribution with degrees of freedom instead.
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.