Statistics·Glossary term

T-Test

T-Test A/B testing Reference guide

T-Test is a concept used in statistical tests & methods.

Quick definition: A t-test compares an estimated mean difference with its standard error to assess whether it is compatible with a stated null value. Common forms are one-sample, independent two-sample, and paired t-tests.

What is t-test?

A t-test compares an estimated mean difference with its standard error to assess whether it is compatible with a stated null value. Common forms are one-sample, independent two-sample, and paired t-tests. In experimentation, its value comes from matching the method to a predeclared estimand: the population, randomization unit, outcome, comparison, and time window that the product decision actually concerns. A named test cannot substitute for that design work.

Reliable analysis begins before the statistic is calculated. Define eligible users, stabilize treatment assignment, log exposure, preserve a consistent denominator, and wait for outcomes to mature. Check allocation and data quality; a sample ratio mismatch can undermine a randomized comparison even when a calculation is numerically correct.

How t-test works

For independent groups, Welch’s t-test uses t=(x̄₁−x̄₂)/√(s₁²/n₁+s₂²/n₂) and an approximate degrees of freedom. It does not require equal variances and is generally a safer default than the pooled-variance t-test. The pooled form estimates a common variance and is appropriate only when that assumption is credible. The paired form instead applies a one-sample t-test to within-pair differences.

The calculation should be reproducible from a frozen analysis dataset. Retain assignment, eligibility, exposure, outcome timestamps, exclusions, and aggregation rules. Do not change the analysis population after a result appears attractive. For a clear discussion of planned outcomes and decisions, see how to write an A/B-test hypothesis.

Assumptions and boundaries

Observations must be independent at the relevant unit, the mean must be meaningful, and the standard-error approximation must be adequate. Mild non-normality is often acceptable with balanced large samples, but small unequal groups with strong skew, heavy tails, or unequal variances require care. A t-test cannot repair clusters, repeated observations, nonrandom treatment assignment, or a post-treatment denominator.

Assumptions should be examined against the experiment architecture rather than treated as a ceremonial checklist. Inspect group sizes, missingness, outcome distributions, dependence, and implementation changes. If the needed assumptions fail, revise the design or use a method that represents the data-generating process; do not simply choose the test that produces the smallest p-value.

t-test in A/B testing

Use a two-sample t-test for a prespecified continuous user-level metric such as time to complete a task or revenue per eligible user when its distribution and variance behavior support the analysis. Randomization allows the difference to be causal for the defined population. Revenue deserves tail, zero, and sensitivity analysis; the mean may be the right business estimand but its uncertainty can be large.

Keep one primary outcome and distinguish secondary outcomes, diagnostics, and guardrails. A favorable result on one metric does not erase increased latency, refunds, or support burden. The discipline behind that separation is explained in primary and guardrail metrics. When several variants, metrics, or segments are compared, plan the comparison family and control the resulting false-positive risk as described in multiple comparisons in A/B testing.

Worked example and workflow

A product test assigns 5,000 users per arm. Mean seven-day revenue is $4.80 in control and $5.05 in treatment; sample standard deviations are $18 and $19. Welch’s standard error is roughly $0.37, so the estimated $0.25 difference has t about 0.68. The result is imprecise, not evidence that revenue is unchanged. The interval, refunds, and conversion help decide whether to collect more data.

A practical workflow is: write the estimand and decision threshold; select the analysis unit and method; calculate sample size and a fixed or sequential monitoring plan; validate assignment and tracking; freeze the dataset after the outcome window; estimate effect size and uncertainty; review guardrails; and document the action and limits. Planning duration from baseline rate, variability, minimum detectable effect, power, and traffic prevents a test from being treated as an open-ended search; see how to calculate sample size.

Interpreting the result

State which t-test was used, the null, degrees of freedom, mean difference, interval, and p-value. Effect direction follows the subtraction order. A statistically significant mean change can be trivial, while a non-significant result may leave material gains and losses plausible.

Use interval estimates to communicate what remains plausible. A confidence interval that crosses zero does not prove no effect, and a narrow interval around a tiny gain may not pay for rollout. Frequentist interval interpretation is often misunderstood; confidence intervals in A/B testing explains the distinction between procedure coverage and a probability statement about one fixed parameter.

Common pitfalls

  • Assuming equal variance by default.
  • Treating many event rows from one user as independent.
  • Using a t-test for a binary metric when a proportion analysis is clearer.
  • Ignoring outliers and skew in monetization metrics.
  • Switching between paired and unpaired tests after inspection.

Also avoid peeking and stopping because a transient result is favorable. Fixed-horizon thresholds assume the stopping rule that was planned. If continuous monitoring is needed, use a validated sequential procedure with predeclared looks and boundaries. Otherwise, wait for the planned horizon and present the full analysis rather than a selected dashboard snapshot.

Decision workflow and reporting checklist

Start with the decision that the analysis will inform. State whether the team is choosing a default experience, deciding whether to invest in another iteration, or determining that the expected benefit is too uncertain to justify further traffic. Translate that action into a minimum useful effect and a maximum tolerable loss in original business units. A threshold is not a statistical convention: it should reflect expected reach, user impact, engineering cost, reversibility, and the availability of safer alternatives.

Before analysis, version the metric definition and preserve the raw ingredients needed to reproduce it. Confirm that each included unit was eligible before treatment, assigned only once according to the intended allocation, exposed as defined, and observed for the complete outcome window. Compare arm sizes and key pre-treatment diagnostics. If implementation, logging, or allocation differs by arm, report the issue and resolve it before interpreting an estimated effect. Excluding problematic records only from one arm can create a more serious bias than ordinary random noise.

After estimating the primary result, make the uncertainty visible. Present arm-level values, the absolute difference, a compatible interval or posterior distribution, and the exact decision rule. Explain how missing values, outliers, repeated measurements, clustering, and concurrent experiments were handled. Review prespecified guardrails on the same mature population, while keeping exploratory slices clearly labeled. If important conclusions depend on modeling choices, show sensitivity analyses rather than one preferred output.

Finally, separate evidence from action. A result may support a full rollout, a gradual reversible release, additional data, a redesign, or no action. Record the chosen action, assumptions, and follow-up monitoring so later teams can learn whether the experimental estimate generalized. This closes the experimentation loop without overstating what a single analysis can establish.

Frequently asked questions about t-test

Which t-test should I choose?

Use paired for natural pairs; otherwise Welch’s independent two-sample test is a robust default for mean comparisons.

Does a t-test require normal raw data?

It requires an adequate sampling distribution for the mean difference; inspect small or highly skewed samples.

Can I use it for conversion?

It can approximate a binary comparison at large samples, but a proportion test or logistic model is clearer.

What does degrees of freedom mean?

It indexes the reference t distribution and reflects uncertainty in the estimated standard error.

Is Welch always better?

It has little cost when variances are equal and protects better when they differ, so it is often preferred.

Summary

t-test is useful when its estimand, mechanics, assumptions, and decision rule match the experiment. Treat the reported statistic as one part of an evidence package: absolute effect, uncertainty, data-quality checks, guardrails, practical value, and a transparent rollout policy. Sound randomization and measurement are more important than a sophisticated formula.

Sources