What Is Hypothesis Testing?
A hypothesis test asks whether the data give enough evidence to reject a null hypothesis. You state the null and alternative hypotheses, compute a test statistic, find the p-value, compare it with the significance level α and then state a conclusion in the context of the problem.
This calculator covers a one-sample z-test (σ known), a one-sample t-test (σ unknown) and a one-proportion z-test, with a two-tailed, left-tailed or right-tailed alternative. It lists each step, so it works as a worked solution as well as a calculator.
Below you will find the formulas, a variables table, a worked example and answers to common questions such as how to choose between z and t and how to write the conclusion.
How to Use the Hypothesis Testing Calculator
- Pick the test that matches your data: mean with σ unknown (most common), mean with σ known, or a proportion.
- Enter the sample statistics and the value claimed by the null hypothesis.
- Choose the alternative hypothesis (two-tailed unless there is a directional claim) and α.
- Follow the five steps listed under the result and read the conclusion.
Hypothesis Testing Formula
One-sample z statistic (σ known)
One-sample t statistic (σ unknown)
One-proportion z statistic
Hypothesis Testing Variables Explained
| Symbol | Meaning | Notes |
|---|---|---|
| H₀, H₁ | Null and alternative hypotheses | |
| α | Significance level | Chosen before testing |
| z or t | Test statistic | Distance from H₀ in standard errors |
| p | p-value | Reject H₀ when p ≤ α |
| SE | Standard error | Depends on the test |
Hypothesis Testing Worked Example
Using the example values (press “Load example” above to try them):
- Step 1. State the hypotheses: H₀: μ = 100; H₁: μ ≠ 100.
- Step 2. Choose the significance level: α = 0.05. Test: One-sample t-test (σ unknown).
- Step 3. Compute the test statistic: t = (103.5 − 100) ÷ 1.89737 = 1.8447 with 39 df.
- Step 4. Find the p-value (two-tailed) = 0.072691 and the critical value ±2.0227.
- Step 5. Decide: p ≥ 0.05, fail to reject H₀. At the 5% significance level, there is not sufficient evidence to conclude that μ differs from 100.
Result: Decision = Fail to reject H₀; Test statistic t = 1.8447; p-value = 0.072691.
The five steps of a hypothesis test
- State the null hypothesis H₀ (a claim of no effect or no difference) and the alternative H₁.
- Choose the significance level α before seeing the data.
- Compute the test statistic that measures how far the sample is from H₀ in standard-error units.
- Find the p-value (or compare with the critical value).
- Decide: reject H₀ if p < α; otherwise fail to reject, and state the conclusion in the context of the problem.
Choosing the right test
| Situation | Test | Tool |
|---|---|---|
| Mean, σ unknown, any n | t-test | This calculator, or t-test calculator for raw data and two groups |
| Mean, σ known (rare) | z-test | This calculator |
| Share of successes vs a claimed share | One-proportion z-test | This calculator |
| Two means | Two-sample t-test | t-test calculator |
| Two proportions (A/B test) | Two-proportion z-test | Statistical significance calculator |
| Counts in categories | Chi-square | Chi-square calculator |
| Three or more means | ANOVA | ANOVA calculator |
Wording conclusions correctly
Say “reject H₀” or “fail to reject H₀”, never “accept H₀”. Failing to reject means the data did not provide sufficient evidence, not that the null is proven. State the result in terms of the original claim, mention α, and give an effect estimate or interval. Statistical significance is not the same as practical importance.
| Result | Conclusion |
|---|---|
| p < α | There is sufficient evidence at the α level to conclude that … |
| p ≥ α | There is not sufficient evidence at the α level to conclude that … |
Conditions to check
- The sample is random and observations are independent (sample under 10% of the population).
- For a mean with small n: the population is roughly normal, or n is at least about 30.
- For a proportion: np₀ and n(1 − p₀) are both at least 10.
- Outliers are checked and explained.
Where Hypothesis Testing Is Used
Statistics coursework
Following the standard steps of a test with every step shown.
Testing a mean
Comparing a sample mean with a claimed value using z or t.
Testing a proportion
Checking whether an observed proportion differs from a claim.
Writing conclusions
Getting a sentence that states the decision in plain words.
Common Hypothesis Testing Mistakes to Avoid
- Write H₀ and H₁ in terms of parameters (μ, p), not sample statistics.
- Pick one- or two-tailed before looking at the data.
- Use t unless the population σ is truly known.
- A confidence interval gives more information than the decision alone.
Hypothesis Testing Terms and Definitions
- Null hypothesis H₀
- The default claim of no effect or no difference.
- Alternative hypothesis H₁
- The claim you look for evidence of.
- Test statistic
- A standardised measure of how far the sample is from H₀.
- p-value
- The probability of a result at least this extreme if H₀ is true.
Hypothesis Testing FAQs
What is hypothesis testing?
A method for using sample data to decide whether there is enough evidence to reject a claim about a population.
What are the null and alternative hypotheses?
The null is the claim of no effect; the alternative is what you seek evidence for. For example H₀: μ = 100 against H₁: μ ≠ 100.
When do I reject the null hypothesis?
When the p-value is below the significance level α, or equivalently when the test statistic is beyond the critical value.
What is the difference between a z-test and a t-test?
A z-test needs a known population standard deviation. A t-test estimates it from the sample and uses the heavier-tailed t distribution.
What does “fail to reject” mean?
The sample did not provide enough evidence against H₀. It does not prove H₀ is true.
How do I choose between one-tailed and two-tailed?
Use two-tailed unless the research question is explicitly directional and was set before data collection.
Does a confidence interval agree with the test?
Yes. A two-sided test at level α rejects H₀ exactly when the hypothesised value lies outside the (1 − α) confidence interval.