Skip to main content

Section 7.5 The sampling distribution in other scenarios

In SectionΒ 7.1, SectionΒ 7.3, and SectionΒ 7.4, we studied the expected value, standard error, and shape for sample proportions and sample means. The same principles apply to other sample statistics as well. In this section, we consider the sampling distribution of statistics based on two independent samples.

Subsection 7.5.1 Sampling distribution for two samples

Many studies compare parameters across two populations. For example, we might ask whether the average weight of almonds from one supplier differs from that of another, or whether one treatment produces better outcomes than another. In such cases, we take independent random samples from each population and compare sample statistics.

Subsubsection 7.5.1.1 Difference in sample means

Suppose we compare the average weight of chocolate-covered almonds (population 1) against the average weight of coffee beans (population 2). The sample statistic of interest is the difference in sample means: \(\overline{X}_1 - \overline{X}_2\text{.}\)
Let population 1 have mean \(\mu_1\) and standard deviation \(\sigma_1\text{,}\) and let population 2 have mean \(\mu_2\) and standard deviation \(\sigma_2\text{.}\) We draw independent random samples of sizes \(n_1\) and \(n_2\text{.}\) Then by the CLT:
\begin{equation*} \overline{X}_1 - \overline{X}_2 \sim \mathrm{Normal}\!\left( \mu_1 - \mu_2,\; \sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}} \right) \end{equation*}
Notice that when computing the standard error of the difference, we add the variances rather than subtract them. This is because both samples contribute uncertainty independently: adding or subtracting two random quantities always increases the total uncertainty.
Exercises Exercises
1.
In the context of comparing two samples, why do we add variances instead of subtracting when finding the standard error of a difference?
  1. Because variances cancel out.
  2. Because adding reflects the total uncertainty contributed by both independent samples.
  3. Because subtracting would give negative results.
  4. Because variances are not related to standard errors.
Answer.
B. Because adding variances reflects the total uncertainty contributed by both independent samples.

Subsubsection 7.5.1.2 Difference in sample proportions

We can also compare two sample proportions. Suppose we want to compare the proportion of red balls in the bowl (population 1) with the proportion of almonds heavier than 3.8 grams in the almond bowl (population 2). We take a sample of \(n_1 = 50\) balls and a sample of \(n_2 = 60\) almonds.
The process is:
  1. Draw a random sample from population 1 and compute \(\widehat{p}_1\) = proportion of red balls.
  2. Draw an independent random sample from population 2 and compute \(\widehat{p}_2\) = proportion of almonds with weight \(> 3.8\) g.
  3. Compute the difference \(\widehat{p}_1 - \widehat{p}_2\text{.}\)
We can simulate this:
virtual_prop_red <- bowl |>
  rep_slice_sample(n = 50, reps = 1000) |>
  summarize(prop_red = mean(color == "red"))
virtual_prop_almond <- almonds_bowl |>
  rep_slice_sample(n = 60, reps = 1000) |>
  summarize(prop_almond = mean(weight > 3.8))
prop_joined <- virtual_prop_red |>
  inner_join(virtual_prop_almond, by = "replicate") |>
  mutate(prop_diff = prop_red - prop_almond)
prop_joined
ggplot(prop_joined, aes(x = prop_diff)) +
  geom_histogram(binwidth = 0.04, boundary = 0, color = "white") +
  labs(x = "Difference in sample proportions",
       title = "Histogram of 1000 differences in sample proportions")
A histogram showing the distribution of 1000 differences in sample proportions between red ball proportions and heavy almond proportions.
Figure 7.5.1. The distribution of 1000 differences in sample proportions.
The histogram is also bell-shaped, centered around a negative value of approximately \(-0.05\text{,}\) reflecting the fact that the proportion of almonds heavier than 3.8 grams is somewhat higher than the proportion of red balls.
For \(\overline{X}_1\) (proportion of red balls, \(n_1 = 50\)) and \(\overline{X}_2\) (proportion of almonds \(> 3.8\) g, \(n_2 = 60\)), the CLT gives:
\begin{equation*} \overline{X}_1 - \overline{X}_2 \sim \mathrm{Normal}\!\left( p_1 - p_2,\; \sqrt{\frac{p_1(1-p_1)}{n_1} + \frac{p_2(1-p_2)}{n_2}} \right) \end{equation*}
Exercises Exercises