E. The T-Test

Two-Sample T-Test

Calculator
Two-Sample
T-Test Calculator
We often want to know whether the means of two populations on some outcome differ. For example, there are many questions in which we want to compare two categories of some categorical variable (e.g., compare males and females) or two populations receiving different treatments in context of an experiment. The two-sample t-test is a hypothesis test for answering questions about the mean where the data are collected from two random samples of independent observations, each from an underlying normal distribution:

The steps of conducting a two-sample t-test are quite similar to those of the one-sample test. And for the sake of consistency, we will focus on another example dealing with birthweight and prenatal care. In this example, rather than comparing the birthweight of a group of infant to some national average, we will examine a program's effect by comparing the birthweights of babies born to women who participated in an intervention with the birthweights of a group that did not.

A comparison of this sort is very common in medicine and social science. To evaluate the effects of some intervention, program, or treatment, a group of subjects is divided into two groups. The group receiving the treatment to be evaluated is referred to as the treatment group, while those who do not are referred to as the control or comparison group. In this example, mothers who are part of the prenatal care program to reduce the likelihood of low birthweight is the treatment group, with a control group comprised of women who do not take part in the program.

Returning to the two-sample t-test, the steps to conduct the test are similar to those of the one-sample test.

Establish Hypotheses

The first step to examining this question is to establish the specific hypotheses we wish to
examine. Specifically, we want to establish a null hypothesis and an alternative hypothesis to be evaluated with data.

In this case:
  • Null hypothesis is that the difference between the two groups is 0. Another way of stating the null hypothesis is that the difference between the mean of the treatment group of birthweight for program babies and the mean of the control group of birthweight for poor women is zero.
  • Alternative hypothesis - the difference between the observed mean of birthweight for program babies and the expected mean of birthweight for poor women is not zero.

Calculate Test Statistic

Calculation of the test statistic requires three components:

1. The average of both sample (observed averages)

Statistically, we represent these as

Mathematical Markup

2. The standard deviation (SD) of both averages

Statistically, we represent these as

Mathematical Markup

3. The number of observations in both populations, represented as

Mathematical Markup From hospital records, we obtain the following values for these components:

  Treatment Control
Average Weight 3100 g 2750 g
SD 420 425
n 75 75
With these pieces of information, we calculate the following statistic, t:

Mathematical Markup

Use This Value To Determine P-Value

Having calculated the t-statistic, compare the t-value with a standard table of t-values to determine whether the t-statistic reaches the threshold of statistical significance.

With a t-score so high, the p-value is 0.001, a score that forms our basis to reject the null hypothesis and conclude that the prenatal care program made a difference.