📚 Case Study Practice: Applying CCEA Statistics | 案例分析实战演练:应用 CCEA 统计
A-Level CCEA Statistics exams often require you to apply hypothesis testing, confidence intervals, correlation, regression and chi‑squared tests to real‑life scenarios. This article walks you through a complete case study centred on a coffee shop that claims its large cups contain 500 ml of coffee. You will work with simulated data, perform appropriate statistical analyses, and learn how to structure exam‑ready answers.
A-Level CCEA 统计考试常常要求你将假设检验、置信区间、相关、回归和卡方检验应用到真实场景中。本文带你完整走过一个以某咖啡店为中心的综合案例,该店声称其大杯咖啡容量为 500 毫升。你将处理模拟数据,执行合适的统计分析,并学会搭建符合考试要求的答案结构。
1. Scenario and Data Description | 案例背景与数据描述
A coffee shop chain claims that its 'large' coffee cup has an average volume of 500 ml. The quality control team randomly selects 40 large cups and records the actual volume (in ml). At the same time, they measure the drink temperature (°C), customer satisfaction score (from 1 to 10), note the shift (morning or evening) and ask each customer for their gender and the type of coffee ordered (Latte, Cappuccino or Americano). This multi‑faceted dataset allows us to test the manufacturer's claim, compare shifts, explore relationships and investigate independence.
某咖啡连锁店声称其“大杯”咖啡的平均容量为 500 毫升。质控小组随机抽取 40 杯大杯咖啡并记录实际容量(毫升)。同时,他们测量了饮品温度(°C)、顾客满意度评分(1 至 10)、记录班次(早班或晚班),并询问每位顾客的性别和所点咖啡类型(拿铁、卡布奇诺或美式)。这个多维度数据集使我们能够检验厂商的声称、比较班次、探索关系并检验独立性。
2. Descriptive Statistics and Visualisation | 描述性统计与可视化
The summary statistics for the 40 volume measurements are shown in the table below. A histogram of the data is roughly bell‑shaped, with no obvious outliers.
40 个容量测量值的汇总统计量如下表所示。数据的直方图大致呈钟形,没有明显的异常值。
| Statistic | Value (ml) |
|---|---|
| Sample size, n | 40 |
| Mean, x̄ | 498.5 |
| Median | 499.0 |
| Standard deviation, s | 6.2 |
| Minimum | 484 |
| Maximum | 512 |
| Q1 | 494 |
| Q3 | 503 |
The mean (498.5 ml) is slightly below 500 ml, and the standard deviation indicates that individual cups vary by about 6.2 ml around the mean. A boxplot would show the median close to the centre of the box, suggesting symmetry.
均值(498.5 毫升)略低于 500 毫升,标准差表明单杯容量围绕均值波动约 6.2 毫升。箱线图将显示中位数靠近箱体中央,表明对称性。
3. Constructing a Confidence Interval for the Mean | 构造均值的置信区间
To estimate the true population mean volume μ, we construct a 95% confidence interval. Because the population standard deviation is unknown, we use the t‑distribution with 39 degrees of freedom.
为估计真实的总体平均容量 μ,我们构建一个 95% 置信区间。由于总体标准差未知,我们使用自由度为 39 的 t 分布。
Standard error = s / √n = 6.2 / √40 ≈ 0.980 ml
t0.025, 39 ≈ 2.023 (from tables)
95% CI = x̄ ± t × SE = 498.5 ± 2.023 × 0.980 = 498.5 ± 1.983
Interval = (496.52 ml, 500.48 ml)
We are 95% confident that the true mean volume lies between 496.5 ml and 500.5 ml. Crucially, the claimed value of 500 ml falls within this interval, so the data are compatible with the claim.
我们有 95% 的把握认为真实平均容量介于 496.5 毫升与 500.5 毫升之间。关键在于,声称值 500 毫升落在该区间内,因此数据与声称相符。
4. One‑Sample t‑Test: Testing the Claimed Volume | 单样本 t 检验:检验声称容量
We now formally test the hypothesis that the population mean equals 500 ml against a two‑sided alternative at the 5% significance level.
我们现在在 5% 显著性水平下,正式检验总体均值等于 500 毫升的双侧备择假设。
H₀: μ = 500 (the average volume is 500 ml) / H₀: μ = 500(平均容量为 500 毫升)
H₁: μ ≠ 500 (the average volume is not 500 ml) / H₁: μ ≠ 500(平均容量不是 500 毫升)
Test statistic t = (x̄ - μ₀) / (s/√n) = (498.5 - 500) / 0.980 ≈ -1.53
The critical values for a two‑tailed t‑test with df = 39 are ±2.023. Since |t| = 1.53 < 2.023, we fail to reject H₀.
自由度为 39 的双侧 t 检验临界值为 ±2.023。因为 |t| = 1.53 < 2.023,我们不能拒绝原假设。
There is insufficient evidence at the 5% level to conclude that the true mean volume differs from the 500 ml claim. The result is consistent with the confidence interval containing 500.
在 5% 水平下,没有足够证据表明真实平均容量与声称的 500 毫升不同。这一结果与置信区间包含 500 相一致。
5. Two‑Sample t‑Test: Comparing Morning and Evening Shifts | 双样本 t 检验:比较早班与晚班
We suspect that the mean volume might differ between morning and evening shifts. Separate random samples were taken: 35 cups from the morning shift and 30 from the evening shift. The summary statistics are:
我们猜测早班和晚班的平均容量可能存在差异。分别抽取了随机样本:早班 35 杯,晚班 30 杯。汇总统计量如下:
| Shift | n | Mean (ml) | s (ml) |
|---|---|---|---|
| Morning | 35 | 497.8 | 5.9 |
| Evening | 30 | 499.4 | 6.5 |
We assume equal population variances and perform a two‑sample pooled t‑test at the 5% level, testing H₀: μ₁ = μ₂ vs H₁: μ₁ ≠ μ₂.
我们假定总体方差相等,并在 5% 水平上进行双样本合并 t 检验,检验 H₀: μ₁ = μ₂ 与 H₁: μ₁ ≠ μ₂。
Pooled variance sp² = [(34×5.9²) + (29×6.5²)] / (35+30-2) ≈ 38.22
sp ≈ √38.22 ≈ 6.18 ml
Standard error of difference = sp × √1/35 + 1/30 ≈ 6.18 × 0.249 ≈ 1.54
t = (497.8 - 499.4) / 1.54 ≈ -1.04
Degrees of freedom = 35 + 30 - 2 = 63. The two‑tailed critical value t0.025,63 is approximately 2.00. |t| = 1.04 < 2.00, so we fail to reject H₀.
自由度为 63,双侧临界值约为 2.00。|t| = 1.04 < 2.00,因此我们不能拒绝原假设。
There is no significant difference in the mean coffee volume between morning and evening shifts. The small observed difference could easily be explained by sampling variability.
早班与晚班的平均咖啡容量无显著差异。观察到的微小差异很可能只是抽样波动造成的。
6. Correlation Analysis: Volume and Temperature | 相关分析:容量与温度
We want to know whether the volume of coffee served is related to its temperature. Using the 40 pairs of observations, the Pearson correlation coefficient is computed.
我们希望了解供应的咖啡容量是否与其温度相关。利用这 40 对观测数据,计算了皮尔逊相关系数。
r = 0.32
gests a weak positive linear relationship. We test H₀: ρ = 0 against H₁: ρ ≠ 0 using the t‑statistic for correlation.
这表明存在弱的正线性关系。我们使用相关系数的 t 统计量来检验 H₀: ρ = 0 与 H₁: ρ ≠ 0。
t = r √n-2 / √1 - r² = 0.32 × √38 / √1 - 0.1024
t ≈ 0.32 × 6.164 / 0.947 ≈ 2.08
With df = 38, the two‑tailed critical value at 5% stically significant linear correlation between volume and temperature, albeit a weak one.
自由度为 38 时,5% 双侧临界值约为 ±2.024。由于 2.08 > 2.024,我们拒绝 H₀,并得出结论:容量与温度之间存在统计上显著的线性相关,尽管相关性较弱。
7. Linear Regression: Predicting Satisfaction from Temperature | 线性回归:用温度预测满意度
We now examine whether the temperature of the coffee (x, in °C) can predict customer satisfaction (y, score 1–10). The least‑squares regression line fitted to the 40 data points is:
我们现在研究咖啡的温度(x,单位 °C)能否预测顾客满意度(y,评分 1–10)。对 40 个数据点拟合的最小二乘回归直线为:
ŷ = 1.2 + 0.09x
The intercept (1.2) has no practical interpretation when temperature is zero, but the slope of 0.09 indicates that for every 1°C increase in temperature, satisfaction is predicted to increase by 0.09 points on average.
截距 1.2 在温度为零时没有实际解释意义,但斜率 0.09 表明温度每升高 1°C,满意度平均预测增加 0.09 分。
| Parameter | Coefficient | Standard Error | t | p‑value |
|---|---|---|---|---|
| Intercept | 1.20 | 1.05 | 1.14 | 0.261 |
| Temperature | 0.090 | 0.021 | 4.29 | <0.001 |
The t‑test for the slope (H₀: β = 0) yields t = 4.29 with a p‑ is a significant predictor. The coefficient of determination R² is about 0.45, meaning 45% of the variation in satisfaction is explained by temperature.
对斜率进行 t 检验(H₀: β = 0)得到 t = 4.29,p 值 < 0.001,因此温度是一个显著预测变量。决定系数 R² 约为 0.45,意味着满意度变异中有 45% 可由温度解释。
8. Chi‑Squared Test of Independence: Coffee Type and Gender | 卡方独立性检验:咖啡种类与性别
We survey 200 customers and cross‑classify their choice of coffee (Latte, Cappuccino, Americano) with gender. The observed frequencies are:
我们调查了 200 位顾客,并将他们选择的咖啡类型(拿铁、卡布奇诺、美式)与性别进行交叉分类。观察频数如下:
| Latte | Cappuccino | Americano | Total | |
|---|---|---|---|---|
| Male | 28 | 22 | 30 | 80 |
