T-Test Calculator

Enter your sample results to test a claim about a mean or a difference of means.

The mean of your sample.

The mean claimed by the null hypothesis.

The standard deviation of your sample, 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ˉ=52, μ0=50, s=4, n=16\bar{x} = 52,\ \mu_0 = 50,\ s = 4,\ n = 16

t=2, df=15, p=0.063945, do not reject H0 at the 5% level\displaystyle t = 2,\ \text{df} = 15,\ p = 0.063945,\ \text{do not reject }H_0\text{ at the 5\% level}

p-value

0.063945\displaystyle 0.063945

Significance level

0.05\displaystyle 0.05

Decision

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

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

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

    With the standard deviation estimated from the sample as s=4s = 4, the statistic follows a t distribution with ν=n−1=15\nu = n - 1 = 15 degrees of freedom instead of a normal curve.

    t=xˉ−μ0s/n=52−504/16=21=2\begin{aligned} t &= \frac{\bar{x} - \mu_0}{s/\sqrt{n}} \\ &= \frac{52 - 50}{4/\sqrt{16}} \\ &= \frac{2}{1} \\ &= 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. The t distribution has ν=15\nu = 15 degrees of freedom.

    p=2×P(T>∣t∣)=2×0.031973≈0.063945\begin{aligned} p &= 2 \times P\left(T > |t|\right) \\ &= 2 \times 0.031973 \approx 0.063945 \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 not, so do not reject H0H_0: there is not enough evidence at the 5% level to say that the population mean differs from 50.

    p=0.063945, α=0.05, p≥α⇒do not reject H0p = 0.063945,\ \alpha = 0.05,\ p \ge \alpha \Rightarrow \text{do not reject } H_0
  5. Result

    So t=2t = 2, p=0.063945p = 0.063945, and the null hypothesis is not rejected at the 5% level.

Worked examples