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.