For AI agents: a documentation index is available at /llms.txt. Append .md to any page URL for markdown, or send Accept: text/markdown.
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.
The p-value is the probability of observing a metric delta at least as large as the measured one if the treatment had no effect, which is the null hypothesis. Statsig marks a metric statistically significant when its p-value is below the Type I error threshold (0.05 by default), using a two-sample z-test, or Welch's t-test when the degrees of freedom are below 100. Use the p-value to decide whether an effect exists; use the confidence interval to judge how large it is.
In both tests, the p-value depends on the metric mean and variance that Statsig computes for the test and control groups.
A p-value below usually coincides with a confidence interval that doesn't cross zero. For the exception with relative deltas under the Delta Method and Fieller Intervals, refer to confidence 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. Pulse shows these values on the Statistics tab of a metric.
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. In Pulse, 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.
Was this helpful?