Hypothesis Testing Calculator

Set up and test statistical hypotheses step by step. Calculate test statistic, find critical value, and make a decision for one-sample z-test or t-test with clear interpretation.

📊 Statistics📐 Reject H0 if |test stat| > critical value🔢 Math
Test type
Sample mean x̄
Null hypothesis mean μ0
SD (σ for z-test, s for t-test)
Sample size n
Significance level α
Please enter valid values.

Formula & Reference

VariableSymbolFormulaUnits
Hypothesis Testing CalculatorReject H0 if |test stat| > critical valuedecision

Step-by-Step Examples

Example 1
Z-test: Quality Control

Machine fills bags. Target μ=500g, σ=10g known. Sample: n=36, x̄=503g. Test at α=0.05.

  • H0: μ=500, H1: μ≠500 (two-tailed)
  • SE = 10/√36 = 10/6 = 1.667
  • z = (503-500)/1.667 = 1.80
  • Critical z = ±1.96 (α=0.05, two-tailed)
  • |1.80| < 1.96: Fail to reject H0
  • Bags are being filled correctly
✓ z=1.80, fail to reject H0
Example 2
T-test: Teaching Method

H0: new method same as old (μ=75). Sample: n=25, x̄=80, s=12.

  • SE = 12/√25 = 2.40
  • t = (80-75)/2.40 = 2.08
  • df = 24, critical t = ±2.064 (α=0.05)
  • 2.08 > 2.064: Reject H0
  • New method significantly better!
✓ t=2.08, reject H0 (significant)
Example 3
One-Sided Test

H0: μ ≤ 50. H1: μ > 50 (one-tailed). n=100, x̄=52, σ=15.

  • z = (52-50)/(15/10) = 2/1.5 = 1.333
  • Critical z (one-tailed, α=0.05) = 1.645
  • 1.333 < 1.645: Fail to reject H0
✓ z=1.33, fail to reject H0 (one-tailed)

Real-World Applications

Common Mistakes to Avoid

⚠️
Setting up hypotheses after seeing data

H0 and H1 must be specified BEFORE looking at data. Cherry-picking based on results inflates false positive rate (p-hacking).

⚠️
Failing to reject ≠ accepting H0

Fail to reject H0 means insufficient evidence against H0. It does NOT prove H0 is true. Absence of evidence is not evidence of absence.

⚠️
Multiple testing without correction

Running 20 tests at α=0.05 expects one false positive. Use Bonferroni correction (α/number of tests) or FDR correction for multiple comparisons.

Frequently Asked Questions

What is a null hypothesis?
H0: the default assumption of no effect or no difference. We test whether data provides sufficient evidence to reject it. We never prove H0; we only fail to disprove it.
What is Type I vs Type II error?
Type I (α): reject true H0 (false positive). Controlled by significance level α. Type II (β): fail to reject false H0 (false negative). Related to power (1-β). There is always a tradeoff.
What is statistical power?
P(reject H0 | H0 is false) = 1-β. Probability of correctly detecting a real effect. Increases with: larger n, larger effect size, larger α, smaller σ. Typical target: 80%.
What is the difference between one-tailed and two-tailed tests?
Two-tailed: tests both directions (μ≠μ0). One-tailed: tests one direction (μ>μ0 or μ<μ0). One-tailed has more power in the hypothesized direction but ignores effects in the other direction.
What is the p-value approach vs critical value approach?
Both give same conclusion. p-value: compare p to α (reject if p<α). Critical value: compare |statistic| to critical value (reject if larger). p-value approach gives more information.

Related Math Calculators

Formula Explorer connections

Interpretation: This formula summarizes data, models uncertainty or supports inference about a population or random process. Assumption: The sampling design and distribution assumptions must match the data. Independence, sample size, outliers and measurement quality can materially affect interpretation.

Interquartile Range (IQR) Calculator →Least-Squares Regression Calculator →Line of Best Fit Visualizer Calculator →Math Formula Explorer →