t test

Enter your data to get the hypotheses, the t value, the critical value, the p-value and a plain reading of the decision. Which test to use when is explained in Chapter 6.

Test type

Question: Do the means of two independent groups (two varieties, two regions) differ?
Example: Two wheat varieties were each tested in eight plots (kg/da). Do their yields differ?

n = 8, mean 532.13

n = 8, mean 494.88

H0:μ1=μ2H_0: \mu_1 = \mu_2H1:μ1≠μ2H_1: \mu_1 \neq \mu_2
-4-2024-2.1452.145calculated 3.77t (df = 14)

The red area is the rejection region (α = 0.05). The green line is the value calculated from your data.

H₀ rejected: the difference is significant

The difference between the two group means (37.25) is statistically significant. It cannot be explained by chance.

p-value = 0.0021 (significant at 1%, **)

How was it calculated?

tcalct_{calc} = 3.768

  1. Compute the mean and variance of each group.

    xˉ1=532.125,s12=538.6964,n1=8\bar{x}_1 = 532.125,\quad s_1^2 = 538.6964,\quad n_1 = 8
  2. xˉ2=494.875,s22=242.9821,n2=8\bar{x}_2 = 494.875,\quad s_2^2 = 242.9821,\quad n_2 = 8
  3. Since the variances are assumed equal, the two variances are pooled.

    sp2=(n1−1)s12+(n2−1)s22n1+n2−2=7⋅538.6964+7⋅242.982114=390.8393s_p^2 = \dfrac{(n_1-1)s_1^2 + (n_2-1)s_2^2}{n_1+n_2-2} = \dfrac{7\cdot 538.6964 + 7\cdot 242.9821}{14} = 390.8393
  4. Standard error of the difference:

    Sxˉ1−xˉ2=sp2(1n1+1n2)=9.8848S_{\bar{x}_1-\bar{x}_2} = \sqrt{s_p^2\left(\dfrac{1}{n_1}+\dfrac{1}{n_2}\right)} = 9.8848
  5. How many standard errors is the difference between the two means?

    t=xˉ1−xˉ2Sxˉ1−xˉ2=532.125−494.8759.8848=3.768t = \dfrac{\bar{x}_1 - \bar{x}_2}{S_{\bar{x}_1-\bar{x}_2}} = \dfrac{532.125 - 494.875}{9.8848} = 3.768
  6. Degrees of freedom n₁ + n₂ − 2 = 14.

  7. Compare the calculated value with the table (critical) value.

    ∣tcalc∣=3.768>ttab=2.145|t_{calc}| = 3.768 > t_{tab} = 2.145
  8. The calculated value is in the rejection region: H₀ is rejected. The p-value (0.0021) is smaller than α = 0.05.