What Is Hypothesis?
A hypothesis test starts with a null hypothesis, H₀, and an alternative, H₁. You reject H₀ when the sample mean falls beyond the critical value for your significance level.
Enter the hypothesised mean, the true mean you want to detect, the standard deviation, n and α. The calculator gives the critical z and critical sample mean, the power, β and the n needed for your target power, with a chart of both sampling distributions.
The sections below explain power, Type II error and how to plan a sample size.
How to Use the Hypothesis Calculator
- Enter μ₀ and the mean you want to detect.
- Enter σ, n and α.
- Pick the alternative.
- Read the critical value, power and required n.
Hypothesis Formula
Standard error
Sample size
Hypothesis Variables Explained
| Symbol | Meaning | Notes |
|---|---|---|
| μ₀ | Hypothesised mean | |
| μ₁ | True mean to detect | |
| α | Significance level | |
| β | Type II error rate |
Hypothesis Worked Example
Test μ₀ = 100 against μ₁ = 105 with σ = 15, n = 36 and α = 0.05 (two-tailed). SE = 2.5, shift = 2, critical z = 1.96, and the power is about 0.516. To reach power 0.80 you need n = 71.
With the example values loaded in the calculator above, the steps are:
- H₀: μ = 100; H₁: μ ≠ 100.
- Standard error = σ ÷ √n = 15 ÷ √36 = 2.5.
- Critical z for α = 0.05 (two-tailed) = ±1.95996, so reject H₀ when x̄ is beyond 95.1001 or 104.9.
- If the true mean is 105, the standardised shift is (105 − 100) ÷ 2.5 = 2, giving power 0.516005.
- Required n = ((z_α + z_power)·σ ÷ (μ₁ − μ₀))² = 71 (rounded up).
Result: Null hypothesis H₀ = μ = 100; Alternative hypothesis H₁ = μ ≠ 100; Power if the true mean is 105 = 0.516005; n needed for power 0.8 = 71.
How to Read a Power Calculation
This tool sets up a test before you collect data. Testing μ₀ = 100 against a true mean of 105 with σ = 15, n = 36 and α = 0.05 gives a standard error of 2.5, a critical z of 1.96 and a power of about 0.516. That means the test would detect a true shift of 5 only about half the time.
To reach a power of 0.80 you need n = 71. Power rises with a larger sample, a larger true effect, a larger α and a smaller σ. The Type II error β is 1 minus the power, the chance of missing a real effect.
Where Hypothesis Is Used
Planning a study
Find the sample size that gives the power you want.
Writing hypotheses
See H₀ and H₁ written out for your test.
Critical values
Get the critical z and the critical sample mean.
Understanding Type II error
See how β changes with n and effect size.
Common Hypothesis Mistakes to Avoid
- Decide the smallest effect worth detecting before you compute power.
- Aim for a power of at least 0.8 in the planning stage, which is a common convention.
- A two-tailed test needs a larger sample than a one-tailed one for the same effect.
- This calculation assumes σ is known. With an estimated σ, use a t-based power calculation.
Hypothesis Terms and Definitions
- Power
- The probability of rejecting H₀ when H₁ is true.
- Type II error
- Failing to reject a false H₀, with probability β.
Hypothesis FAQs
How do I write H0 and H1?
H₀ states no effect, for example μ = 100. H₁ states the alternative you want evidence for, such as μ ≠ 100 for a two-tailed test or μ > 100 for a one-tailed test.
What is the critical value?
It is the cut-off for the test statistic. For a two-tailed z-test at α = 0.05 it is ±1.96. Results beyond it lead you to reject H₀.
What is the power of a test?
It is the probability of rejecting H₀ when the true mean really is different, equal to 1 − β. In the example it is about 0.516.
How many samples do I need?
Enough to reach your target power for the smallest effect you care about. For a shift of 5 with σ = 15, α = 0.05 and power 0.80, you need about 71.