Z-Test Calculator

Enter your sample results and the claim to test to get the z statistic and a decision.

The mean of your sample.

The mean claimed by the null hypothesis.

The standard deviation, which must be more than 0.

How many observations were in the sample.

Tail

Two-tailed counts both ends of the curve; left or right counts one end.

Significance levelα\alpha

How unlikely a result must be, if the null hypothesis were true, before it is rejected.

Try

Result

You enteredxˉ=105, μ0=100, σ=15, n=36\bar{x} = 105,\ \mu_0 = 100,\ \sigma = 15,\ n = 36

z=2, p=0.0455, reject H0 at the 5% level\displaystyle z = 2,\ p = 0.0455,\ \text{reject }H_0\text{ at the 5\% level}

p-value

0.0455\displaystyle 0.0455

Significance level

0.05\displaystyle 0.05

Decision

Reject H0\displaystyle \text{Reject } H_0
Show the work
  1. Null and alternative hypotheses

    The null hypothesis H0H_0 says the population mean equals 100. The alternative hypothesis H1H_1 is what the test looks for, and it makes this a two-tailed test.

    H0:μ=100H1:μ≠100\begin{gathered} H_0: \mu = 100 \\ H_1: \mu \ne 100 \end{gathered}
  2. Test statistic

    The test statistic measures how many standard errors the sample mean xˉ=105\bar{x} = 105 lies from the hypothesised mean μ0=100\mu_0 = 100. The standard deviation σ=15\sigma = 15 is known and n=36n = 36.

    z=xˉ−μ0σ/n=105−10015/36=52.5=2\begin{aligned} z &= \frac{\bar{x} - \mu_0}{\sigma/\sqrt{n}} \\ &= \frac{105 - 100}{15/\sqrt{36}} \\ &= \frac{5}{2.5} \\ &= 2 \end{aligned}
  3. p-value

    The p-value is the probability, if H0H_0 were true, of a test statistic at least as extreme as the one observed. It is two-tailed, so count the area beyond the statistic in both tails, which by symmetry is twice one tail.

    p=2×P(Z>∣z∣)=2×0.02275≈0.0455\begin{aligned} p &= 2 \times P\left(Z > |z|\right) \\ &= 2 \times 0.02275 \approx 0.0455 \end{aligned}
  4. Decision

    Compare the p-value with the significance level α=0.05\alpha = 0.05: if p<αp < \alpha the result would be too unlikely under H0H_0, so reject it. Here it is, so reject H0H_0: there is enough evidence at the 5% level to say that the population mean differs from 100.

    p=0.0455, α=0.05, p<α⇒reject H0p = 0.0455,\ \alpha = 0.05,\ p < \alpha \Rightarrow \text{reject } H_0
  5. Result

    So z=2z = 2, p=0.0455p = 0.0455, and the null hypothesis is rejected at the 5% level.

Worked examples