In SectionΒ 7.1 and SectionΒ 7.3, we studied sampling distributions for the sample proportion, a special case of the sample mean for binary (0/1) data. We now extend these results to the general case of the sample mean for continuous data, using chocolate-covered almonds as our population.
The bowl contains 5000 almonds with a population mean weight of \(\mu = 3.64\) grams and a population standard deviation of \(\sigma = 0.392\) grams.β1β
The sd() function uses \(n - 1\) in the denominator, but for 5000 observations the difference from using \(n\) is not relevant for practical purposes.
The weights range from about 2.6 to 4.6 grams, with the most common weights falling between 3.6 and 4.0 grams. Notice that the distribution is not symmetric β it has a slight left skew with a longer left tail. This is an important point: the CLT says that the sampling distribution of the sample mean will be approximately normal even when the population distribution itself is not normal.
Just as we physically scooped balls from the bowl in SubsectionΒ 7.1.2, we can physically scoop almonds. FigureΒ 7.4.3 shows one almond on a scale, and FigureΒ 7.4.4 shows a random sample of 25 almonds weighed together.
The total weight of the 25 almonds in this sample was 88.6 grams, giving a sample mean of \(88.6/25 = 3.544\) grams. The almonds_sample data frame has columns for the replicate number, the almond ID, and the weight. Letβs visualize the distribution of weights in this sample:
The sample means range from below 3.4 to above 3.85 grams, with most values falling between 3.5 and 3.8 grams. The distribution is almost symmetric and bell-shaped, with a slightly longer left tail β mirroring the slight left skew of the population distribution, though much less pronounced.
Subsection7.4.4The sampling distribution of the sample mean
As with sample proportions, we study the sampling distribution of the sample mean by examining three key characteristics: its center, its spread (and the effect of sample size), and its shape.
Instead of Bernoulli trials recording 0 or 1, here each trial records the weight of a randomly selected almond. We select one almond, record its weight, return it to the bowl, and repeat. We have 25 trials total.
Let \(X_1\) be the weight of the first randomly selected almond β a random variable. Similarly, \(X_2, X_3, \ldots, X_{25}\) are the weights of the subsequent almonds. After drawing all 25 almonds, we have realized values \(x_1, x_2, \ldots, x_{25}\) (e.g., 3.0 g, 3.9 g, 4.0 g, and so on).
To study all three key characteristics of the distribution of \(\overline{X}\text{,}\) we take 1000 samples each of sizes 25, 50, and 100 and compute the histograms of sample means:
# Segment 1: sample size = 25 ------------------------------
# 1.a) Calculating the 1000 sample means, each from random samples of size 25
virtual_mean_weight_25 <- almonds_bowl |>
rep_slice_sample(n = 25, reps = 1000) |>
summarize(mean_weight = mean(weight), n = n())
# 1.b) Plot distribution via a histogram
ggplot(virtual_mean_weight_25, aes(x = mean_weight)) +
geom_histogram(binwidth = 0.02, boundary = 3.6, color = "white") +
labs(x = "Sample mean weights for random samples of 25 almonds", title = "25")
# Segment 2: sample size = 50 ------------------------------
# 2.a) Calculating the 1000 sample means, each from random samples of size 50
virtual_mean_weight_50 <- almonds_bowl |>
rep_slice_sample(n = 50, reps = 1000) |>
summarize(mean_weight = mean(weight), n = n())
# 2.b) Plot distribution via a histogram
ggplot(virtual_mean_weight_50, aes(x = mean_weight)) +
geom_histogram(binwidth = 0.02, boundary = 3.6, color = "white") +
labs(x = "Sample mean weights for random samples of 50 almonds", title = "50")
# Segment 3: sample size = 100 ------------------------------
# 3.a) Calculating the 1000 sample means, each from random samples of size 100
virtual_mean_weight_100 <- almonds_bowl |>
rep_slice_sample(n = 100, reps = 1000) |>
summarize(mean_weight = mean(weight), n = n())
# 3.b) Plot distribution via a histogram
ggplot(virtual_mean_weight_100, aes(x = mean_weight)) +
geom_histogram(binwidth = 0.02, boundary = 3.6, color = "white") +
labs(x = "Sample mean weights for random samples of 100 almonds", title = "100")
Figure7.4.7.Comparing histograms of sample means when using different sample sizes.
All three histograms are bell-shaped and centered around the same value, approximately equal to the population mean \(\mu = 3.64\) grams. Sampling variation decreases as the sample size increases.
From these results, comparing across sample sizes:
The expected value is approximately \(3.64\) or \(3.65\) grams \(\approx \mu = 3.64\) in all cases. Sample means are unbiased estimators of the population mean.
The standard error decreases as \(n\) increases. For \(n = 100\text{:}\)\(SE \approx \sigma/10\text{.}\) For \(n = 25\text{:}\)\(SE \approx \sigma/5\text{.}\) For \(n = 50\text{:}\)\(SE \approx \sigma/7\text{.}\)
Subsection7.4.6The Central Limit Theorem revisited
The histograms in FigureΒ 7.4.7 are bell-shaped, suggesting a normal approximation. We can confirm this by overlaying normal distribution curves, as shown in FigureΒ 7.4.8 and FigureΒ 7.4.9.
The CLT applies here just as it did for proportions: when the sample size is large enough, the distribution of \(\overline{X}\) is approximately normal with mean \(\mu\) and standard deviation \(\sigma/\sqrt{n}\text{:}\)
This is remarkable because the population distribution of almond weights is not symmetric (it has a left skew), yet the sampling distribution of the sample mean is approximately normal for sufficiently large \(n\text{.}\)