The t-test is used to determine if means of two data sets differ significantly. This calculator performs one sample and two samples t-test and generates an explanation with all steps.
Result:
You entered the following data:
| GROUP 1 | GROUP 2 |
| $$ \begin{array}{cccc}72&68&74&77\\82&80&75&85\\69&71&&\end{array} $$ | $$ \begin{array}{cccc}79&73&82&81\\88&86&83&91\\75&78&&\end{array} $$ |
The means of Group 1 and Group 2 ARE significantly different at p < 0.05.
| Summary | ||
| Group 1 | Group 2 | |
| Mean | 75.3 | 81.6 |
| Variance | 28.81 | 28.84 |
| Stand. Dev. | 5.3675 | 5.3703 |
| n | 10 | 10 |
| t | -16.7781 | |
| d.o.f | 9 | |
| critical value | 2.262 | |
| since | t | > criticall value | => | there is sig. diff. |
Explanation
Step 1: Find $ t $ value and degrees of freedom
To find $ t $ value and degrees of freedom we will use following formulas:
| $$ \begin{aligned} t &= \frac{ \overline{X_D} } {\frac{S_D}{\sqrt{n}}} \\ d.o.f &= n-1 \end{aligned} $$ |
$ \overline{X_D} $ = Mean of differences between pairs $ S_{X_D} $ = Standard deviation of differences between pairs $ d.o.f $ = degrees of freedom $ n $ = Total number of values in first(second) dataset |
In this example we have:
$$ \begin{aligned} \overline{X_D} &\approx -6.3 \\ S_{X_D} &= \sqrt{\frac{1}{n-1} \sum\limits_{i=1}^n \left( X_{Di} - \overline{X_D} \right)^2} \approx 1.1874 \\ \end{aligned}$$After substituting these values into the formula for $ t $ we have:
$$ t = \frac{ \overline{X_D}} { \frac{S_D}{\sqrt{n}}} = \frac{ -6.3 } { \frac{ 1.1874 }{\sqrt{ 10 }}} \approx \color{blue}{ -16.7781 } $$The degrees of freedom is:
$$ d.o.f = n - 1 = 9 $$Step 2: Determine critical value for $ t $ with degrees of freedom = 9 and $ \alpha = 0.05 $.
In this example the critical value is $ \color{red}{ 2.262 } $ (see the table below).
The absolute value of the calculated $ t $ exceeds the critical value $(\color{blue}{ 16.7781 } > \color{red}{ 2.262 })$, so the means are significantly different.
We use the t-test to compare the mean values of two datasets. Of course, the means of two groups will always differ by some amount; what matters is whether the difference is statistically significant or not.
There are three types of t-test.
A two-sample t-test compares means of two datasets.
One sample t-test checks if the mean of a sample is equal to a target value.
A paired t-test is used when we measure the same subject two times, for example, before and after the treatment.
In order to use a t-test, the data have to be normally distributed.
The two-sample t-test is most common. In the following example we will perform a t-test for two groups of unequal sizes.
Suppose we have the following data.
Group 1: 8 12 9 10 11 16 5 17
Group 2: 3 5 12 10 4 2
We want to compare the means of these two groups.
Step 1: Compute sample size, mean and st. deviation.
For group 1 we have
Size n1 = 8
Mean μ1 = 11
Standard deviation s1 = 3.7417
For group 2 we have
Size n2 = 6
Mean μ2 = 6
Standard deviation s2 = 3.6969
Step 2: Calculate the test statistics t
sp = √((n11-1)s12+(n2-1)s22)/(n1+n2-2)
=
sp = 3.7231
t = (μ1 - μ2)/sp√1/n1 + 1/n2) = 2.4867
Step 3: Calculate the p value
Degrees of freedom = n1+n2-2 = 12
p12,0.05 = 2.179
The means are significantly different because the calculated t exceeds the critical value.
1. T Test - in-depth tutorial for beginners
2. Standard deviation calculator - with all steps
3. Step-by-step solution - using Microsoft Excel.
Twelve younger adults and twelve older adults conducted a life satisfaction test. The data arepresented in the table below. Compute the appropriate t-test.
$$\begin{array}{c|cccccccccc} \text{older} & 12 & 16 & 10 & 19 & 20 & 11 & 14 & 25 & 16 & 12 \\ \text{younger} & 10 & 9 & 12 & 15 & 14 & 15 & 13 & 12 & 21 & 15 \end{array}$$Are the means between two data sets are significantly different at level α < 0.05.
$$ \begin{array}{c|cccccccccc} \text{group 1} & 5.1 & 4.3 & 3.1 & 4.6 & 3.9 & 4.3 & 4.7 & 3.8 & 4.1 & 5.0 \\ \text{group 2} & 2.1 & 3.4 & 1.8 & 3.5 & 4.0 & 2.5 & 2.1 & 3.5 & 2.8 & 1.9 \end{array}$$