Two-Sample t-Test

March 23, 2018

Two-Sample t-Test

A two-sample t-test takes sample data from two groups and summarises it as a single t-value. The process is very similar to a one-sample t-test, with the exception that a two-sample t-test requires independent groups for each sample.


Formula

As a two-sample t-test needs to account for 2 samples, there is a slight difference in the denominator of the formula vs. that of the one-sample t-test.

If both samples have the same sample variance,

\begin{align}t = \frac{\bar{x}_1 - \bar{x}_2}{\sqrt{s^2 (\frac{1}{n_1} + \frac{1}{n_2})}}\end{align}

In the more likely event that the two samples have differing sample variance, use the following.

\begin{align}t = \frac{\bar{x}_1 - \bar{x}_2}{\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}}\end{align}


Example

We want to test if drinking milk prior to taking an exam will improve test scores. Two groups are chosen at random, and one group is made to drink milk while the other serves as the control. Assuming that our data constitutes a random sample from a normal distribution, determine the liklihood that drinking milk prior to an exam improves test scores.

Group that drank milk

Group that did not drink milk


Determine the t-Value

\begin{align}t & = \frac{20 - 18}{\sqrt{\frac{2}{13} + \frac{3}{15}}} \
& \approx 3.36 \end{align}


Evaluate the t-Value

Using a t-value calculator, we can determine the probability will be greater than or equal to 3.36. In our example, there is a 0.11% chance that we will obtain such a result. As this is a very low probability, it is highly probable that drinking milk prior to a test does improve test scores1.


  1. This is a fictitious example. Regardless, any attempts to replicate this will likely not cause you any personal harm. [return]
comments powered by Disqus