How to Use a T-Test to Compare Two Means

A T-Test is a statistical test used to compare the means of two data sets. It is used to determine whether the difference between the two means is statistically significant, and if so, to assess the size of the difference. The T-Test uses the T-value and P-value to determine the probability that the difference between the two means is due to chance, and whether the result is statistically significant or not.


In statistics, there are three commonly used t-tests:

: Used to compare a population mean to some value.

: Used to compare two population means.

: Used to compare two population means when each observation in one sample can be paired with an observation in the other sample.

This article shares several examples of how each of these types of t-tests are used in real life situations.

Examples: One Sample t-tests in Real Life

Example 1: Manufacturing

A manufacturing engineer wants to know if some new process leads to a significant improvement in mean battery life of some product. 

To test this, he measures the mean battery life for 50 products created using the new process and performs a one sample t-test to determine if the mean battery life is different from the mean battery life of products made using the current process.

Example 2: Medicine

A doctor may want to know if some new drug leads to a significant reduction in blood pressure compared to the current standard drug used.

To test this, he recruits 20 subjects to participate in a study in which they each take the new drug for one month. He can perform a one sample t-test to determine if the mean reduction in blood pressure is significantly greater than the mean reduction that results from the current standard drug.

Examples: Independent Two Sample t-tests in Real Life

Example 1: Studying Techniques

A professor wants to know if two studying techniques lead to different mean exam scores.

To test this, he assigns 30 students to use one studying technique and 30 students to use a different studying technique in preparation for an exam. He then has each student take the same exam. He can use an independent two sample t-test to determine if the mean is different between the two groups.

Example 2: Weight Loss

To test this, she assigns 20 subjects to use diet A for one month and 20 subjects to use diet B for one month. She then measures the total weight loss of each subject at the end of the month. She can use an independent two sample t-test to determine if the mean weight loss is different between the two groups.

Examples: Paired Samples t-tests in Real Life

Example 1: Fuel Treatment

Researchers want to know if a new fuel treatment leads to a change in the mean miles per gallon of a certain car. To test this, they conduct an experiment in which they measure the mpg of 11 cars with and without the fuel treatment.

Since each car is used in each sample, the researchers can use a paired samples t-test to determine if the mean mpg is different with and without the fuel treatment.

Example 2: Plant Growth

A botanist wants to know if two different soils lead to different levels of evaporation in plants.

To test this, she measures the mean amount of evaporation for 20 plants in soil A for one month. Then, she transfers each of the 20 plants to soil B and measures the mean amount of evaporation for one month.

Since each of the plants is used in both soil types, she can use a paired samples t-test to determine if the mean evaporation is different between the two soils.

x