Real-World Examples
Suppose that your company has two factories—one in Chicago and one in Atlanta—that produce tens of thousands of widgets each day. At each factory, the quality control department samples 1,000 widgets a week and tests them. The data you have are the number of defective widgets found each week over a three-month period. The data are shown in Figure 1. You can see that the average number of defects at the Atlanta plant is higher than at the Chicago plant. Your question is whether the total number of defects (in all the widgets produced, not just the quality control sample) is different between the plants. This is a textbook application of the TTEST() function.
Figure 1 Using a T-Test to evaluate quality control data
Looking at the figure, you can see in the formula bar that the following formula is entered in cell C17:
=TTEST(B3:B14,C3:C14,2,2)
The result is 0.11133181 or just over 11%. Because this is well above the 5% cutoff, you must conclude that there is no real difference. In other words, the Atlanta plant is not producing more defective widgets. Rather, it was just by chance that the quality control department tested more defective widgets at that plant.
Now let’s return to the Type argument of the TTEST() function. The value of 2 specifies a test for data where the two samples have equal variance. If this is not the case, pass a value of 1 for an unequal variance test. To be honest, this makes only a very slight difference in almost all situations, but it’s worth knowing about just in case.
You are more likely to run across a situation in which you want to pass a value of 3 for the Type argument. This specifies a paired T-Test in which each value in one sample is paired with a value in the other sample. Obviously, the two data sets must contain the same number of data points. But what does paired mean? It means the two measurements in each pair are linked in some way that minimizes differences other than the one being measured.
For example, an evaluation of a weight loss treatment might take before and after weights for each subject. Such data are shown in Figure 2.
Figure 2 Using a paired T-Test to evaluate before/after data
You can see from the TTEST() result in cell C17 that the probability is just over 0.01 or 1%. Because that is well within the 5% cutoff, you can assume that the weight loss treatment did have a significant effect.
Some people are intimidated by the very mention of statistics, but there’s no need to be. With the information in this article you might find uses for the TTEST() function in your own work.