Stat Trek

Teach yourself statistics

Stat Trek

Teach yourself statistics


Sampling Distribution: Difference Between Means

Statistics problems often involve comparisons between sample means from two independent populations. This lesson describes the sampling distribution for the difference between sample means.

In this lesson, you'll learn how to find the mean of the sampling distribution, how to compute the standard deviation of the sampling distribution, how to compute the standard error of the sampling distribution, and how to find the cumulative probability that the difference between sample means will be less than or equal to some critical value, which we call d.

Sampling Distribution

Consider the following scenario. We have two populations with population means equal to μ1 and μ2. We take all possible simple random samples of size n1 from population 1, and all possible simple random samples of size n2 from population 1. For each sample from population 1, we compute the sample mean x1; and for each sample from population 2, we compute the sample mean x2. And finally, for every possible pairing of sample 1 with sample 2, we compute the difference between sample means; that is, we compute x1 - x2.

Assume that the samples are independent; that is, observations in one sample are not affected by observations in the other sample. Given that assumption, we know the following about the sampling distribution for the difference between sample means.

  • If both sample sizes are sufficiently large, the sampling distribution for the difference between independent sample means will be approximately normally distributed. We know this from the central limit theorem.

    Note: If a population distribution is roughly bell-shaped, a sample size of 30 is big enough to justify an assumption of normality. If a population distribution is not bell-shaped, the sample size should be bigger.

  • If both populations are approximately normally distributed, the sampling distribution will be described by a t-distribution. (Guidelines for defining degrees of freedom for t statistics are described at https://stattrek.com/statistics/degrees-of-freedom).
  • The mean of the sampling distribution (μd) is the expected value of the difference between all possible sample means. Thus,

    μd = E(x1 - x2) = μ1 - μ2

    where xi is the mean of sample i, and μi is the mean of population i.

Note: If both populations are large and normally distributed, you could use a t-distribution or a normal distribution to describe the sampling distribution. Use a t-distribution when the population standard deviation is unknown, and use a normal distribution when the population standard deviation is known.

Standard Deviation of Sampling Distribution

The standard deviation of the difference between sample means (σd) is approximately equal to:

σd = sqrt( σ12 / n1 + σ22 / n2 )

It is straightforward to derive this formula, based on material covered in previous lessons. The derivation starts with a recognition that the variance of the difference between independent random variables is equal to the sum of the individual variances. Thus,

σ2d = σ2 (x1 - x2) = σ2 x1 + σ2 x2

If the populations N1 and N2 are both large relative to n1 and n2, respectively, then

σ2 x1 = σ21 / n1

σ2 x2 = σ22 / n2

σd2 = σ12 / n1 + σ22 / n2

σd = sqrt( σ12 / n1 + σ22 / n2 )

Standard Error of Sampling Distribution

Typically, we don't know the values for population standard deviations, σ1 and σ2. And, if we don't know the population standard deviations, we cannot compute the standard deviation of the difference between sample means (σd).

However, we can estimate the population standard deviation from sample data, as shown below:

s = sqrt [ Σ ( xi - x )2 / ( n - 1 ) ]

where s is the sample standard deviation (i.e., the sample estimate of the population standard deviation), x is the sample mean, xi is the ith element from the sample, n is the number of elements in the sample.

Substituting sample estimates of each population standard deviation into the equation for σd, we get:

SEd = sqrt( s21 / n1 + s22 / n2 )

In this equation, SEd is a sample estimate of the standard deviation of the difference between sample means (σd), which is known as the standard error of the difference between sample means. Also, s1 is the standard deviation of sample 1 (i.e., the sample estimate of σ1), s2 is the standard deviation of sample 2 (i.e., the sample estimate of σ2), n1 is the sample size in sample 1, and n2 is the sample size in sample 2.

In future lessons, you will see that being able to compute the standard error from sample data is essential for inferential statistics. It will allow us to compute confidence intervals for the difference between means and to test hypotheses about the difference between means.

How to Find Probability

The sampling distribution of the difference between two sample means is a probability distribution. You can use the sampling distribution to find a cumulative probability for any difference between sample means. Specifically, you can find:

P(x1 - x2) ≤ d)

where x1 is the mean in sample 1, x1 is the mean in sample 2, and d is a constant called the critical value.

Finding the probability that the difference between sample means is no greater than the critical value d is a four-step process:

Step 1: Find Mean of Distribution

The mean of the sampling distribution of the difference between independent sample means is the mean of population 1 minus the mean of population 2. Thus,

μ = μ1 - μ2

where μ is the mean of the sampling distribution, μ1 is the mean of population 1, and μ2 is the mean of population 2.

Step 2: Find Standard Deviation

Earlier in this lesson (see above), we explained how to compute standard deviation of the sampling distribution when you know each population variance. And we showed how to estimate the standard deviation with the standard error when you don't know the population variance. For convenience, we repeat those formulas below:

σ = sqrt( σ12 / n1 + σ22 / n2 )

SE = sqrt( s21 / n1 + s22 / n2 )

where σ is the standard deviation of the sampling distribution, SE is the standard error, σ1 and σ2 are popuation standard deviations, s1 and s2 are sample estimates of population standard deviations, and n1 and n2 are sample sizes from each population.

Step 3: Transform d Into z- or t-Score

If you know the standard deviation of the sampling distribution and neither sample size is small (less than 30), compute a z-score using this formula:

z = (d – μ) / σ

where d is the critical value for which we want to find a probability, μ is the mean of the sampling distribution, and σ is the standard deviation of the sampling distribution.

If you don't know the standard deviation of the sampling distribution and neither sample size is small (less than 30), compute a t-score using this formula:

t = (d – μ) / SE

where SE is the standard error of the sampling distribution.

If you compute a t-score, you will also need to find the degrees of freedom. There are several ways to find degrees of freedom (e.g., see https://stattrek.com/statistics/degrees-of-freedom). The easiest and most conservative way is to let degrees of freedom (df) equal the smaller sample size minus one.

df = min(n1 - 1, n2 - 1 )

where n1 and n2 are sample sizes in the two groups.

Step 4: Find Probability

Find the probability for the z-score or a t-score that you calculated in Step 3; and you have found the probability that a mean difference is no greater than the critical value, d.

You can find the probability for the z-score or a t-score from a handheld graphing calculator, from a written probability table commonly found in the appendix of introductory statistics texts, or from an online probability calculator, like Stat Trek's normal distribution calculator and t distribution calculator.

Difference Between Means: Sample Problem

In this section, we work through a sample problem to show how to find probability, using the four-step solution described above. In this example, we will use Stat Trek's Normal Distribution Calculator to compute probabilities.

Normal Distribution Calculator

The Normal Distribution Calculator solves common statistical problems, based on the normal distribution. The calculator computes cumulative probabilities, based on three simple inputs. Clear instructions guide you to an accurate solution, quickly and easily. If anything is unclear, frequently-asked questions and sample problems provide straightforward explanations. The calculator is free. It can found in the Stat Trek main menu under the Stat Tools tab. Or you can tap the button below.

Normal Distribution Calculator

Problem 1

For boys, the average number of absences in the first grade is 15 with a standard deviation of 7; for girls, the average number of absences is 10 with a standard deviation of 6.

In a nationwide survey, suppose 100 boys and 50 girls are randomly sampled. What is the probability that the male sample will have at most three more days of absences than the female sample?

(A) 0.025
(B) 0.035
(C) 0.045
(D) 0.055
(E) None of the above

Solution

The correct answer is B. Here's the four-step solution:

  • Step 1. Find the mean difference (male absences minus female absences) in the population.

    μd = μ1 - μ2 = 15 - 10 = 5

  • Step 2. Find the standard deviation of the difference.

    σd = sqrt( σ12 / n1 + σ22 / n2 )

    σd = sqrt(72/100 + 62/50) = sqrt(49/100 + 36/50)

    σd = sqrt(0.49 + .72) = sqrt(1.21) = 1.1

  • Step 3. Find the z-score that is produced when boys have three more days of absences than girls. When boys have three more days of absences, the number of male absences minus female absences is 3; so the critical value d is 3. And the associated z-score is

    z = (d - μ)/σ = (3 - 5)/1.1 = -2/1.1 = -1.818

  • Step 4. Find the probability. To find this probability, we use Stat Trek's Normal Distribution Calculator. Specifically, we enter the following inputs: -1.818, for the z-score; 0, for the mean; and 1, for the standard deviation. (It is not necessary to compute the mean or standard deviation of the z-score, because every z-score has a mean of 0 and a standard deviation of 1.)
Normal Distribution Calculator

We find that the probability of probability of a z-score being -1.818 or less is about 0.035. This means the probability of our survey finding that boys are absent 3 or fewer days than girls is 0.035.

Note: Some analysts might have used the t-distribution to compute probabilities for this problem. We used the normal distribution because the population standard deviation was known and the sample size was large. If the population standard deviation had been unknown, we would have used the t-distribution. But since the sample size was large, results using the t distribution would have been very similar; so for this problem, the choice between a normal distribution and a t distribution was not critical. You can find guidelines for choosing between the normal distribution and the t distribution at https://stattrek.com/statistics/normal-vs-t-distribution.