Hypothesis Test Calculator
Z & t tests · proportions · p-value · distribution plot
Result
Enter parameters and click Perform Test
Run hypothesis tests for means, proportions, or group comparisons.
Distribution Visualization
Python Compiler
What Is Hypothesis Testing?
Hypothesis testing is a statistical procedure used to determine whether sample data provides sufficient evidence to reject a claim (the null hypothesis) about a population parameter. It is fundamental to scientific research, quality control, and data-driven decision making.
State Hypotheses
Define H₀ (null — no effect) and H₁ (alternative — the claim you want to test). H₀ always contains the equality.
Calculate Evidence
Compute a test statistic that measures how far the sample result is from the null hypothesis value in standard-error units.
Make Decision
Compare the p-value to α. If p ≤ α, reject H₀. Otherwise, fail to reject H₀. Never “accept” H₀.
Test Formulas
Decision Making
If p-value ≤ α
Reject H₀. The result is statistically significant. There is sufficient evidence to support H₁.
If p-value > α
Fail to reject H₀. The result is not statistically significant. Insufficient evidence to support H₁.
Common Significance Levels
| α | Confidence | z* (two-tailed) | Use Case |
|---|---|---|---|
| 0.10 | 90% | ±1.645 | Exploratory analysis, social science |
| 0.05 | 95% | ±1.960 | Standard for most research |
| 0.01 | 99% | ±2.576 | High-stakes, medical trials |
Type I and Type II Errors
❌ Type I Error (α)
False positive. Rejecting H₀ when it is actually true. The probability is controlled by α (significance level).
Example: Concluding a drug works when it does not.
⚠️ Type II Error (β)
False negative. Failing to reject H₀ when it is actually false. Related to sample size and effect size.
Example: Missing a real drug effect due to small sample.
✅ Correct: Reject true H₁
H₀ is false and we correctly reject it. This is the desired outcome of a well-powered test.
✅ Correct: Fail to reject true H₀
H₀ is true and we correctly fail to reject it. No false alarm.
Statistical Power = 1 − β — the probability of correctly rejecting a false H₀. Increase power by increasing sample size, using a larger α, or when the true effect size is large.
When to Use Each Test
| Test | Data Type | When to Use |
|---|---|---|
| Z-test (mean) | Continuous | σ is known, or n > 30 with known population SD |
| T-test (mean) | Continuous | σ is unknown (use sample s). Works for any n with normal population |
| One-proportion Z | Categorical | Compare sample proportion to a claimed value. Need np₀ ≥ 5 and n(1−p₀) ≥ 5 |
| Two-proportion Z | Categorical | Compare proportions from two independent groups. Uses pooled proportion under H₀ |
Tip: In practice, the population σ is almost never known, so the T-test is the most commonly used test for means. The Z-test is primarily used for proportions and in textbook problems.