---
title: "p-Value Calculation"
description: "What p-values mean in Statsig experiments, how they are computed, and how to interpret them alongside confidence intervals and lift estimates."
product: general
lang: en
last_updated: 2025-09-18
token_estimate: 1137
---
# p-Value Calculation

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.

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

Statsig marks a metric as statistically significant when its p-value is below the significance level $\alpha$, which is 0.05 by default. To compute the p-value, Statsig compares the [mean](https://docs.statsig.com/experiments/statistical-methods/metric-deltas) and [variance](https://docs.statsig.com/experiments/statistical-methods/variance) of each group with a two-sample z-test. When the degrees of freedom $\nu$ are below 100, it uses Welch's t-test instead. If you turn on a correction for multiple comparisons, such as [Bonferroni](https://docs.statsig.com/experiments/statistical-methods/methodologies/bonferroni-correction) or [Benjamini-Hochberg](https://docs.statsig.com/experiments/statistical-methods/methodologies/benjamini-hochberg-procedure), 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](https://docs.statsig.com/experiments/statistical-methods/confidence-intervals) tells you how large it might be. A p-value below $\alpha$ 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:

$$
\begin{split}
Z &= \frac{\overline X_t - \overline X_c}{\sqrt{var(\overline X_t)+ var(\overline X_c)}} \\
&= \frac{\overline X_t - \overline X_c}{\sqrt{var(\Delta \overline{X})}} \\
&= \frac{\overline X_t - \overline X_c}{\sqrt{\sigma_{\overline{X}_t}^2 + \sigma_{\overline{X}_c}^2}}
\end{split}
$$

where:

- $Z$ is the observed z-statistic, not the z-critical value $Z_{\alpha/2}$.
- $var(\Delta \overline{X})$ is the variance of the absolute delta of means.
- $var(\overline{X}_i)$ is the [variance of the sample mean](https://docs.statsig.com/experiments/statistical-methods/variance) of the control or treatment group.
- $\sigma_{\overline{X}_t}$ 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:

$$
p-value = 2 \cdot \frac{1}{\sqrt{2\pi}} \int \limits _{-\infty}^{-|Z|}{e^{-t^2/2}dt}
$$

### 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 $\nu < 100$.

Statsig computes the t-statistic (t-score) with the same formula as the two-sample z-statistic, and the degrees of freedom $\nu$ as:

$$
\nu = \frac{\left(var(\overline X_t) + var(\overline X_c)\right)^2}{\frac{var(\overline X_t)^2}{N_t - 1}+\frac{var(\overline X_c)^2}{N_c - 1}}
:= \frac{var(\Delta\overline{X})^2}{\frac{var(\overline X_t)^2}{N_t - 1}+\frac{var(\overline X_c)^2}{N_c - 1}}
$$

Statsig then obtains the p-value from the t-distribution with $\nu$ degrees of freedom.

### One-sided z-test

For a one-sided z-test, Statsig computes the z-statistic $Z$ with the same formula as the two-sided test, and takes the p-value from the standard normal cumulative distribution function with these differences:

$$
p-value =
\begin{cases} 1 - \frac{1}{\sqrt{2\pi}} \int \limits _{-\infty}^{Z}{e^{-t^2/2}dt} &\text{if right-hand test}\\
\frac{1}{\sqrt{2\pi}} \int \limits _{-\infty}^{Z}{e^{-t^2/2}dt} &\text{if left-hand test}
\end{cases}
$$

where $Z$ is the signed z-statistic, not the absolute value that the two-sided p-value uses. When $\nu$ is below 100, Statsig takes the one-sided p-value from the t-distribution with $\nu$ degrees of freedom instead.

