Hypothesis tests: binomial, Poisson, t-test and chi-squared

A hypothesis test asks whether data is surprising if a claim is true. You compare a p-value or test statistic with a significance level and state the conclusion in context.

Write 2x or 2*x to multiply, ^ for powers, and ; between simultaneous equations. You can also type factor, expand, derivative of, integrate … from a to b, limit … as x->0 or 15% of 80.

Try an example

Before you start

This page is easier if you are comfortable with:

What this topic covers

State H₀ and H₁, find the probability of a result at least as extreme as observed, and compare with the significance level (test for a binomial proportion). For a mean use the normal test or the t statistic, with a confidence interval; correlation is tested with the correlation test.

Each part of this topic has its own page with the formula, worked examples and a solver: Hypothesis test for a binomial proportion, Hypothesis test for the mean of a normal, Confidence interval for a mean (σ unknown), One-sample t statistic, Hypothesis test for correlation.

Closely related topics: Probability distributions, Averages and spread, Regression and correlation, Probability rules and trees.

What is it used for?

A hypothesis test decides whether data gives enough evidence against a claim. The chi-squared test compares observed counts with the counts expected under a model.

How to solve it

  1. State H₀ and H₁ with the parameter.
  2. Choose the significance level, usually 5%.
  3. Find the probability of a result at least as extreme as observed (the p-value), or the test statistic.
  4. Compare with the significance level or the critical value.
  5. Write the conclusion in words, in context.

Worked examples

The examples marked with a button were worked out by the solver on this page. You can try each one yourself.

Example 1: hypothesis test binomial n=20 p=0.5 observed 15 one tail

Worked out by the solver on this page. Press the button to try it yourself.

Hypothesis test (binomial) Answer checked
Answer
Reject H0: there is evidence at the 5% level that p is greater than 0.5.\text{Reject $H_0$: there is evidence at the 5\% level that p is greater than 0.5.}
  1. State the hypotheses
  2. Under H₀, X follows a binomial distribution
  3. Probability of a result at least as extreme as the one observed
  4. Compare with the significance level
  5. Check: the two tails add to 1
  6. Conclusion

Example 2: hypothesis test binomial n=20 p=0.5 observed 12 one tail

Worked out by the solver on this page. Press the button to try it yourself.

Hypothesis test (binomial) Answer checked
Answer
Do not reject H0: not enough evidence at the 5% level.\text{Do not reject $H_0$: not enough evidence at the 5\% level.}
  1. State the hypotheses
  2. Under H₀, X follows a binomial distribution
  3. Probability of a result at least as extreme as the one observed
  4. Compare with the significance level
  5. Check: the two tails add to 1
  6. Conclusion

Example 3: chi-squared test observed 20,30,50 expected 25,25,50

Worked out by the solver on this page. Press the button to try it yourself.

Chi-squared test Answer checked
Answer
χ2=2,  ν=2, critical value 5.991 ⇒ do not reject H0\chi^2 = 2,\ \ \nu = 2,\ \text{critical value } 5.991\ \Rightarrow\ \text{do not reject } H_0
  1. Hypotheses
  2. Test statistic χ² = Σ (O − E)² / E
  3. Degrees of freedom = number of cells − 1
  4. Critical value at the 5% level with 2 degrees of freedom
  5. Compare
  6. Conclusion
  7. Check: χ² = Σ O²/E − N gives the same value

Example 4: Poisson hypothesis test mean 3 observed 7

Worked out by the solver on this page. Press the button to try it yourself.

Hypothesis test (Poisson) Answer checked
Answer
Reject H0: evidence at the 5% level that the mean rate is higher.\text{Reject $H_0$: evidence at the 5\% level that the mean rate is higher.}
  1. Hypotheses
  2. Under H₀
  3. Probability of a result at least as extreme
  4. Compare with the significance level
  5. Check: summing the tail directly gives the same probability
  6. Conclusion

Special cases

A few situations come up again and again. Knowing them saves time and helps you spot answers that cannot be right.

Binomial test

n = 20, p = 0.5, 15 successes: P(X ≥ 15) = 0.0207

Compare with 5%.

Chi-squared

O = 20, 30, 50; E = 25, 25, 50: 2

Σ(O − E)²/E.

Degrees of freedom

2 × 2 table: 1

(r − 1)(c − 1).

t statistic

x̄ = 52, μ₀ = 50, s = 8, n = 16: 1

(x̄ − μ₀)/(s/√n).

Word problems

State the hypotheses, find the test statistic or tail probability, compare with the significance level, and conclude in context.

Binomial test

n = 20, p = 0.5, observed 15: find P(X ≥ 15).

  1. Add the tail21 700 ÷ 1 048 576
  2. Check: 0.0207 < 0.05, so reject H₀ ✓0.0207

Chi-squared

Observed 20, 30, 50; expected 25, 25, 50.

  1. Terms25/25 + 25/25 + 0
  2. Sum2
  3. Check: 2 on 2 degrees of freedom ✓2

Degrees of freedom Higher

2 × 2 contingency table.

  1. (r − 1)(c − 1)1 × 1
  2. Check: 1 ✓1

t test Higher

x̄ = 52, μ₀ = 50, s = 8, n = 16.

  1. SE8/4 = 2
  2. t2/2
  3. Check: 1 on 15 degrees of freedom ✓1

Common mistakes

Concluding the null is true

H₀ proved ✗

not enough evidence against it ✓

Wording matters.

Using the wrong tail

two-tailed for a one-tailed claim ✗

follow H₁ ✓

Direction.

Forgetting expected counts ≥ 5

ignoring ✗

combine classes ✓

Validity.

Wrong degrees of freedom

n ✗

n − 1 or (r − 1)(c − 1) ✓

Count carefully.

Exam tips

  1. State H₀ and H₁.
  2. One- or two-tailed?
  3. Compare with α.
  4. Conclude in context.
  5. Expected ≥ 5 for chi-squared.

Practice questions

Try each one on paper, then open the answer. Use the solver above to see the full working.

1. χ²: O = 18, 22; E = 20, 20 Foundation

0.4

2. χ²: O = 10, 30; E = 20, 20 Foundation

10

3. Degrees of freedom for a 3 × 4 table Foundation

6

4. t: x̄ = 105, μ₀ = 100, s = 10, n = 25 Higher

2.5

5. P(X ≥ 9) for B(10, 0.5) (4 dp) Higher

0.0107

6. Degrees of freedom for 5 categories, none estimated Higher

4

Practice generator

Unlimited fresh questions with instant marking. Choose a level, work it out on paper, then type your answer.

Solve: …

Key terms

Null hypothesis
H₀, the claim tested.
Alternative hypothesis
H₁.
Significance level
α, e.g. 5%.
p-value
Probability of a result this extreme.
Chi-squared statistic
Σ(O − E)²/E.
Degrees of freedom
Free values in the statistic.

Frequently asked questions

What is a hypothesis test?

A way to decide whether data is evidence against a claim.

What do I compare the p-value with?

The significance level.

What does the chi-squared statistic measure?

How far observed counts are from expected ones.

Which page covers the binomial test?

test for a binomial proportion.

Which page covers the t statistic?

one-sample t statistic.

Which page covers the correlation test?

test for correlation.

More in Statistics and the formula sheets.