🎉 75% of content is free forever — Unlock Premium from $10/mo →
CW
NEWSLIVESearch All Content
đŸ’ŧ Servicesâ„šī¸ Aboutâœ‰ī¸ ContactView Pricing Plansfrom $10

Hypothesis Testing and A/B Test Design: t-Tests, p-Values, and Power

StatisticsHypothesis TestingđŸŸĸ Free Lesson

Hypothesis Testing and A/B Test Design: t-Tests, p-Values, and Power

What You'll Learn

  • 1State null and alternative hypotheses for business questions
  • 2Interpret p-values, effect sizes, and power correctly
  • 3Choose t-tests and chi-square tests appropriately
  • 4Control false discoveries across many metrics and segments

Hypothesis testing provides a disciplined language for deciding whether an observed difference could plausibly arise from random chance alone. t-tests and chi-square procedures cover means and proportions, while power analysis determines sample size before a test launches. p-values are often misread, so careful design, pre-registration, and multiplicity control separate credible experiments from noise mining.

From Business Question to Statistical Hypothesis

Translate the decision into a null hypothesis of no effect and an alternative that matches the business claim. Specify the primary metric, minimum detectable effect, and decision rule before looking at results. This pre-commitment blocks metric shopping and hindsight rationalization.

Choose the test that matches the data: independent t-tests or Welch variants for continuous outcomes across groups, paired tests for before-after on the same units, and chi-square or z-tests for proportions and contingency tables. Check independence, distribution shape, and variance assumptions, or reach for nonparametric alternatives.

p-Values, Effect Sizes, and Power

A p-value is the probability of observing an effect at least as extreme as the sample, assuming the null is true. It is not the probability the null is true, and it says nothing about practical importance. Always report effect size and confidence interval next to the p-value.

Power is the probability of detecting a true effect of a chosen size, typically targeted at 80 percent or higher. Underpowered tests waste traffic by missing real wins and producing unstable estimates. Compute sample size from baseline variance and minimum detectable effect before the experiment starts.

Multiple Testing and Experiment Hygiene

Testing twenty metrics at the 0.05 level expect about one false positive by chance alone. Control family-wise error with Bonferroni or Holm, or control false discovery rate with Benjamini-Hochberg when exploring many hypotheses. Declare one primary metric and treat the rest as guardrails or secondary.

Watch for peeking without correction, sample ratio mismatch, seasonality, network effects, and novelty spikes. Sequential testing or fixed horizons with proper boundaries keep optional stopping from inflating false positives. Document exclusions, iterations, and stopping rules so the result survives peer review.

Common Tests for Analysts

ScenarioTypical testKey assumption
Two group means, continuous metricWelch t-testIndependence, roughly stable variance
Paired before and afterPaired t-testDifferences approximately normal
Proportions between variantsTwo-proportion z-testAdequate counts in each cell
Multi-category associationChi-square testExpected counts not tiny
Non-normal small samplesMann-Whitney or permutationOrdinal or distribution-free comparison
Many simultaneous metricsFDR or Holm correctionDefined family of hypotheses

Real-World Examples

  • Checkout button test — Variant B lifts checkout completion by 1.2 percentage points with a 95 percent interval excluding zero, clearing the pre-agreed minimum detectable effect.
  • Chi-square on plans — A chi-square test shows plan type and upgrade event are associated across three tiers, prompting deeper segment analysis.
  • Underpowered failure — A two-week test with tiny traffic shows no significant difference; analysts recommend a longer horizon rather than declaring equality.
  • Multiple metrics trap — Scanning thirty KPIs finds one significant result; FDR correction reveals it does not survive, preventing a false rollout.

âš ī¸p-Value Is Not an Effect Size

A tiny p-value can accompany a trivially small difference on huge traffic. Require practical significance, interval estimates, and business thresholds before shipping.

Common Mistakes

Stopping a test early when it looks good

Fix: Peeking repeatedly inflates false positives; use fixed horizons or valid sequential boundaries.

Ignoring multiple comparisons across segments

Fix: Pre-specify primary metrics, apply corrections, and treat slice findings as hypotheses for follow-up.

Equating non-significance with no effect

Fix: Non-significance may reflect low power; report the interval and minimum effect the test could have detected.

Key Takeaways

  • Pre-register hypotheses, metrics, and decision rules.
  • Power analysis sets sample size before launch.
  • p-values need effect sizes and confidence intervals.
  • Multiplicity corrections curb false discoveries.

Frequently Asked Questions

What does a p-value of 0.03 mean?

Under the null, results this extreme or more would occur about 3 percent of the time. It is not the probability that the null hypothesis is true.

How long should an A/B test run?

At least one full business cycle, often one to four weeks, and until the pre-calculated sample size is reached without early optional stopping.

When is chi-square better than a t-test?

Use chi-square for counts and proportions across categories; use t-tests for continuous metrics such as revenue per user or session length.

Interview Questions

Q1: How do you size an A/B test?

Estimate baseline rate or variance, choose the minimum detectable effect that matters to the business, pick alpha and power, then compute required sample size per variant and convert to runtime using daily traffic.

Q2: How do you handle many metrics in one experiment?

Define one primary metric for the decision, a set of guardrail metrics with corrections, and label exploratory slices as secondary so false discovery rates stay controlled.


Extended Learning: Beyond the Basics

Key Concepts Summary

This lesson covers fundamental concepts that serve as building blocks for more advanced topics. Master these basics before moving to intermediate and advanced material.

Prerequisite Knowledge

Before studying this topic in depth, ensure you understand:

  • Basic definitions and terminology
  • Core formulas and their derivations
  • Common applications in real-world scenarios
  • Typical pitfalls and misconceptions

Step-by-Step Walkthrough

Let us work through a complete example to solidify understanding:

Step 1: Identify the problem type. Determine which category this problem falls into and which approach is most appropriate.

Step 2: Apply the relevant formula. Substitute known values into the appropriate equation, paying attention to units and constraints.

Step 3: Simplify and solve. Work through the algebra step by step, checking each intermediate result.

Step 4: Verify the answer. Check that the solution satisfies the original conditions and makes logical sense.

Common Mistakes to Avoid

  1. Misidentifying the problem type — Always start by categorizing the problem
  2. Incorrect formula application — Verify the formula applies to your specific case
  3. Unit errors — Always check units are consistent throughout
  4. Sign errors — Pay careful attention to positive and negative values
  5. Rounding too early — Keep full precision until the final answer
  6. Forgetting constraints — Check that solutions satisfy all given conditions

Real-World Applications

Understanding this concept is essential for:

  • Advanced problem solving in examinations
  • Building intuition for more complex topics
  • Developing analytical thinking skills
  • Applying mathematical reasoning to practical situations

Practice Exercises

  1. Basic: Solve 5 problems of increasing difficulty using the core concept.
  2. Intermediate: Apply the concept to word problems with multiple steps.
  3. Advanced: Combine this concept with 2-3 other topics in a comprehensive problem.
  4. Challenge: Create your own problem that requires this concept plus additional knowledge.

Interview and Exam Tips

  • Common question patterns: Identify which exam or interview formats test this topic
  • Time management: Practice completing problems within time constraints
  • Common traps: Know the typical mistakes examiners set as distractors
  • Verification strategy: Develop a quick method to check your answer

Related Topics

Quick Reference Card

ConceptFormula/RuleKey InsightCommon Use
Core DefinitionSee main textUnderstand the intuitionFoundation for all applications
Key FormulaSee main textMemorize the derivationDirect problem solving
Special CaseSee main textRecognize when it appliesSimplifies complex problems
Edge CaseSee main textKnow the limitationsAvoids errors

Further Reading

For students who want to go deeper:

  • Standard textbooks on the subject
  • Research papers applying this concept
  • Online courses with video explanations
  • Practice problem collections with detailed solutions
CW

ChatWhole Learn Editorial Team

Written by experienced data scientists, software engineers, and educators. All content is reviewed by industry professionals to ensure accuracy and relevance.

Last reviewed: 2026-11-14

—
☆☆☆☆☆
0 ratings

Rate & Feedback

Continue Learning

Suggested next tutorials based on this topic

Need Expert Data Analytics Help?

Get personalized tutoring, project support, or professional consulting.

Advertisement