Hypothesis Test Calculator

One-sample z/t style test with approximate p-value.

FreeNo accountOn your device

Runs in your browser. How to verify

Loading tool…

About this tool

Enter a sample mean, the hypothesised mean, the SD, n and α for a two-sided test. A mean of 52 against 50 with SD 4 and n = 36 gives z = 3, p ≈ 0.0027 and rejects H₀.

How to use

1
Step 1
Enter the sample mean and the hypothesised mean μ₀.
2
Step 2
Enter the SD and n.
3
Step 3
Set α, usually 0.05.
4
Step 4
Press Calculate.

How it works

The statistic is (x̄ − μ₀) ÷ (s ÷ √n). The two-sided p-value is the chance of a result at least this extreme if H₀ is true. With the z option the p-value and cut-off come from the normal distribution (1.96 at α = 0.05). With the t option they come from Student's t distribution with n − 1 degrees of freedom, which is shown in the result. If |statistic| exceeds the critical value for α, H₀ is rejected.

z or t = (x̄ − μ₀) ÷ (s ÷ √n)      reject H₀ if |stat| > critical value at α/2      t uses df = n − 1

Worked example

A result that is not significant

Input
x̄ = 50.5, μ₀ = 50, SD = 4, n = 36, α = 0.05
Output
z = 0.75, p ≈ 0.453254: fail to reject H₀
Walkthrough
Standard error = 4 ÷ 6 = 0.6667, so z = 0.5 ÷ 0.6667 = 0.75. That is well inside ±1.96.

Limitations

  • Two-sided only.
  • The z option uses the normal distribution, so for a small sample with an estimated SD choose t. For x̄ = 52, μ₀ = 50, SD = 4, n = 16 the t option gives t = 2 with df = 15, p = 0.0639, and does not reject at 0.05, while the z option would give p = 0.0455 and reject.
  • Needs n of at least 2 and SD above 0.

Questions

What is the z statistic for mean 52, μ₀ = 50, SD 4, n = 36?
3, with a two-sided p of about 0.0027, so reject H₀ at 0.05.
What is the result for mean 50.5 with the same SD and n?
z = 0.75, p ≈ 0.4533: fail to reject.
Should I use this for a small sample with unknown SD?
Yes, pick the t option. It uses Student's t distribution with n − 1 degrees of freedom for the p-value and the cut-off, which is the right choice for a small sample.
What is the t result for mean 52, μ₀ = 50, SD 4, n = 36?
t = 3 with df = 35 and a two-sided p of about 0.0049, so reject H₀ at 0.05.

Features

  • Statistic, p-value and decision
  • z or Student t with df
  • Adjustable α
  • Runs in your browser

Guides

Related resources

Guides and videos from around the web—opens on YouTube or the publisher’s site.

  • Vectors | Essence of linear algebra

    3Blue1Brown

    Linear algebra intuition for matrix and vector tools.

    Watch on YouTube
  • Standard Deviation vs Standard Error

    StatQuest with Josh Starmer

    Avoids mixing SD and SE when reading results panels.

    Watch on YouTube