# Statistics: T-Tests

## Introduction

A t-test is used to test the hypothesis that there is not a statistically significant difference between the means (averages) of two groups.

T-tests are used across many fields to compare two groups. In the healthcare industry, you can use t-tests to compare the life expectancy of one group who receives an experimental treatment and the other which receives a placebo. These operations can also be used as a preliminary test to see if there are differences between two samples before moving on to further analysis of what these differences may be.

The first step to conducting a t-test is to understand which type of t-test is right for your data.

When conducting a t-test in Excel, you can compare group averages in two ways:

1. Comparison of two groups, Group A to Group B, to see if a particular variable, such as income, differs between the two (Independent Samples t-test)

Comparison of the same sample from before and after an intervention to determine if there is a difference between these two points in time (Paired Sample t-test)

## Functions

Once you have determined which of these tests you wish to run, make sure that the Data Analysis ToolPak has been installed in Excel. To check on this, go to the Data tab and check the far right corner to see if you have Data Analysis listed. If you do not, click on Analysis Tools and select the ToolPak to install.

Now that you have this installed, you’re ready to begin!

Next, you will need to have a dataset with two continuous variables. You will then use the AVERAGE formula to calculate the mean for each variable to determine which mean is largest. The larger mean is the value that you should put first in the t-test equation.

Then go to Data > Data Analysis and select one of the following t-tests:

t-Test: Paired Two Sample for Means (Paired Sample t-test)

t-Test: Paired Two-Sample Assuming *Equal Variances (Independent Samples t-test)

t-Test: Paired Two-Sample Assuming *Unequal Variances (Independent Samples t-test)

The example displayed utilizes Paired Two Sample for Means.

*Disclaimer: Due to the small sample size, the t-Test output shown in the example is not statistically fulfilled.

*Equal variances assumes that your samples are of the same size and have similar standard deviations. Unequal variances assumes that your samples are of different sizes and have a different distribution.

Next, in the pop-up box, click into the Variable Range 1 Box and select the cell range that corresponds with the largest mean. Do the same for Variable Range 2, except select the other cell range for the smaller mean. In both of these selections, include the cell that contains the name of the variable.

In the blank box next to Hypothesized Mean Difference, put 0. This value indicates that you are assuming there is no difference between the two groups. The result of the t-test will either reject or fail to reject this hypothesis, which in statistics is usually called the “null hypothesis”. If you reject the null hypothesis, you are indicating there is a difference between the two groups

Click on the box next to Labels to select it and indicate that you have included the label in your variable ranges. The alpha value, or confidence coefficient, is typically 0.05 to indicate a 95% confidence level. Lastly, make sure the New Worksheet option is selected, so that your output will show up on a new tab. ## Practice 