📚 Case Study in Statistical Analysis: From Data to Decision | 统计案例分析实战演练:从数据到决策
This case study takes you through a realistic statistical investigation, from collecting sample data to making a final decision using hypothesis tests. You will apply descriptive statistics, probability, the binomial and normal distributions, and formal inference in one coherent scenario.
本案例研究将带你经历一个真实的统计调查过程,从收集样本数据到使用假设检验做出最终决策。你将在同一个连贯的场景中运用描述性统计、概率、二项分布、正态分布以及正式推断。
1. Introduction to the Case Study | 案例背景介绍
BatteryCo, a manufacturer of alkaline AA batteries, claims that its batteries have a mean lifetime of 100 hours with a known population standard deviation of 8 hours. The company also states that the proportion of defective batteries is no more than 5%. A quality control inspector decides to test these claims by taking a random sample of 50 batteries from the production line.
电池制造商 BatteryCo 声称其碱性 AA 电池的平均寿命为 100 小时,已知总体标准差为 8 小时。该公司还声明次品率不超过 5%。一位质检员决定从生产线上随机抽取 50 个电池来检验这些声称。
The recorded lifetimes (in hours) of the 50 batteries are summarised by a sample mean x̄ = 98.2 hours and a sample standard deviation s = 7.8 hours. In addition, 4 out of the 50 batteries are found to be defective. We will use these data to perform a complete statistical analysis and reach evidence-based conclusions.
这 50 个电池的记录寿命(小时)概括为样本均值 x̄ = 98.2 小时,样本标准差 s = 7.8 小时。此外,50 个电池中有 4 个被发现是次品。我们将使用这些数据进行完整的统计分析,并得出基于证据的结论。
2. Descriptive Statistics: Summarising the Sample | 描述性统计:总结样本
Given the raw data, the first task is to summarise the sample using measures of central tendency and dispersion. For the battery lifetimes, the sample mean is 98.2 hours, which is slightly below the claimed 100 hours. The median, calculated from the ordered data (not fully listed here), is found to be 98.5 hours, suggesting a roughly symmetric distribution.
给定原始数据后,第一项任务就是用集中趋势和离散程度的度量来总结样本。对于电池寿命,样本均值为 98.2 小时,略低于声称的 100 小时。根据排序后的数据(此处未全部列出)计算得到的中位数为 98.5 小时,表明分布大致对称。
The sample standard deviation s = 7.8 hours is close to the known population value of 8 hours. The range is 102.1 − 94.3 = 7.8 hours? Actually, the minimum is 85.2 and maximum 112.4, giving a range of 27.2 hours. The interquartile range (IQR) is Q₃ − Q₁ = 102.1 − 94.3 = 7.8 hours, showing that the middle 50% of batteries have lifetimes tightly clustered.
样本标准差 s = 7.8 小时接近已知的总体值 8 小时。极差为 112.4 − 85.2 = 27.2 小时。四分位距(IQR)为 Q₃ − Q₁ = 102.1 − 94.3 = 7.8 小时,表明中间 50% 的电池寿命紧密聚集。
3. Visualising the Data: Histograms and Box Plots | 数据可视化:直方图与箱线图
A histogram of the 50 lifetimes, with bins of width 5 hours, shows a bell-shaped pattern centered near 98 hours. There are no obvious outliers. This visual check supports the assumption of an approximately normal distribution for the underlying population—a condition that becomes important when we perform a z‑test on the mean.
将 50 个寿命值绘制成组距为 5 小时的直方图,呈现出以 98 小时附近为中心的钟形形态,且无明显异常值。这一可视化检查支持了总体近似服从正态分布的假设——这对随后均值的 z 检验至关重要。
A box plot summarises the five‑number summary: minimum 85.2, Q₁ = 94.3, median = 98.5, Q₃ = 102.1, maximum = 112.4. The box is slightly shifted to the left of the claimed 100 hours, hinting at a possible downward shift, but it is not dramatic. The whiskers are balanced, and no points fall outside the 1.5 × IQR fences, so no outliers need to be treated.
箱线图概括了五数总结:最小值 85.2,Q₁ = 94.3,中位数 98.5,Q₃ = 102.1,最大值 112.4。箱体略微向左偏移于声称的 100 小时,暗示可能存在轻微下移,但并不剧烈。须线对称,且无点落在 1.5 × IQR 栅栏之外,因此无需处理异常值。
4. Probability Foundations: A Quick Refresher | 概率基础:快速回顾
Before advancing to distributions, let us review some basic probability rules that appear within the case. If two events are independent, P(A ∩ B) = P(A) × P(B). For example, if we randomly select two batteries, the probability that both are defective, assuming independence and a defect rate of p = 0.05, is 0.05 × 0.05 = 0.0025.
在进入分布之前,我们先回顾一些案例中用到的基本概率规则。若两事件独立,则 P(A ∩ B) = P(A) × P(B)。例如,假设次品率 p = 0.05 且独立,随机抽取两个电池均次品的概率为 0.05 × 0.05 = 0.0025。
Conditional probability plays a role when assessing the risk of a defective battery coming from a particular production line. Suppose the factory has two lines: Line 1 produces 60% of batteries with a 4% defect rate, and Line 2 produces 40% with a 6% defect rate. Using Bayes’ theorem, the probability that a randomly chosen defective battery came from Line 2 is P(Line 2 | defective) = [0.4×0.06] / [0.6×0.04 + 0.4×0.06] = 0.024/0.048 = 0.5.
评估某一特定生产线出现次品的风险时会用到条件概率。假设工厂有两条生产线:1 号线生产 60% 的电池,次品率 4%;2 号线生产 40%,次品率 6%。利用贝叶斯定理,随机选出一个次品来自 2 号线的概率为 P(2 号线|次品) = [0.4×0.06] / [0.6×0.04 + 0.4×0.06] = 0.024/0.048 = 0.5。
5. Discrete Random Variables: Modelling the Number of Defectives | 离散随机变量:对次品数建模
Let X be the random variable representing the number of defective batteries in a sample of size n = 50. Before knowing the actual distribution, we can treat X as the sum of 50 Bernoulli trials. The expected value of the proportion is p, so E(X) = 50p, and Var(X) = 50p(1−p).
令随机变量 X 表示容量 n = 50 的样本中次品电池的数量。在知道实际分布之前,我们可以将 X 看作 50 次伯努利试验的总和。比例的期望值为 p,因此 E(X) = 50p,Var(X) = 50p(1−p)。
If the company’s claim of p = 0.05 is true, we would expect E(X) = 50×0.05 = 2.5 defective batteries on average, with a variance of 50×0.05×0.95 = 2.375. The standard deviation is √2.375 ≈ 1.541. The observed count of 4 defectives is higher than the expected 2.5, but is this difference statistically significant? We will test this formally in a later section.
若公司声称的 p = 0.05 为真,则平均期望次品数 E(X) = 50×0.05 = 2.5,方差为 50×0.05×0.95 = 2.375,标准差为 √2.375 ≈ 1.541。观测到的 4 个次品高于期望值 2.5,但这种差异是否具有统计显著性?我们将在后续小节中进行正式检验。
6. The Binomial Distribution: Exact Probabilities | 二项分布:精确概率
Under the assumption that batteries are independent and the defect probability is constant, X follows a binomial distribution: X ~ B(50, 0.05). The probability mass function is P(X = k) = C(50, k) × (0.05)ᵏ × (0.95)⁵⁰⁻ᵏ.
在电池相互独立且次品概率恒定的假设下,X 服从二项分布:X ~ B(50, 0.05)。其概率质量函数为 P(X = k) = C(50, k) × (0.05)ᵏ × (0.95)⁵⁰⁻ᵏ。
To assess how surprising 4 defectives are, we calculate the tail probability P(X ≥ 4) = 1 − P(X ≤ 3). Using cumulative binomial tables or software, we find: P(X = 0) ≈ 0.077, P(X = 1) ≈ 0.202, P(X = 2) ≈ 0.261, P(X = 3) ≈ 0.217. Summing these gives P(X ≤ 3) ≈ 0.757, so P(X ≥ 4) ≈ 0.243. There is about a 24.3% chance of observing 4 or more defectives if the true defect rate is 5%, which suggests the observed count is not extremely unlikely.
为评估 4 个次品有多意外,我们计算尾部概率 P(X ≥ 4) = 1 − P(X ≤ 3)。利用二项累积表或软件,求得:P(X=0) ≈ 0.077,P(X=1) ≈ 0.202,P(X=2) ≈ 0.261,P(X=3) ≈ 0.217。将上述相加得 P(X ≤ 3) ≈ 0.757,故 P(X ≥ 4) ≈ 0.243。若真实次品率为 5%,则有约 24.3% 的机会观测到 4 个或更多次品,这表明观测值并非极度罕见。
7. The Normal Distribution and the Central Limit Theorem | 正态分布与中心极限定理
For the sample mean lifetime, even if the population is not perfectly normal, the Central Limit Theorem tells us that the sampling distribution of the mean is approximately normal for a sufficiently large sample. With n = 50, the sampling distribution of x̄ is approximately N(μ, σ²/n). Using the claimed values, x̄ ~ N(100, 8²/50) = N(100, 1.28).
对于样本均值寿命,即使总体并非完美正态,中心极限定理告诉我们,当样本量足够大时,均值的抽样分布近似正态。由于 n = 50,x̄ 的抽样分布近似为 N(μ, σ²/n)。代入声称的数值,x̄ ~ N(100, 8²/50) = N(100, 1.28)。
The standard error of the mean is σ/√n = 8/√50 ≈ 1.1314 hours. Thus, any observed sample mean can be standardised to a z‑score: z = (x̄ − μ) / (σ/√n). This transformation forms the backbone of the one‑sample z‑test that we will perform on the mean lifetime.
均值的标准误为 σ/√n = 8/√50 ≈ 1.1314 小时。因此,任何观测到的样本均值都可被标准化为一个 z 值:z = (x̄ − μ) / (σ/√n)。这一变换构成了我们将对平均寿命执行的单样本 z 检验的基石。
8. Hypothesis Test on the Mean Lifetime | 均值寿命的假设检验
The inspector suspects that the true mean lifetime may be lower than the claimed 100 hours. A one‑tailed z‑test is set up at the 5% significance level. The hypotheses are
H₀: μ = 100 hours
H₁: μ < 100 hours.
质检员怀疑真实平均寿命可能低于声称的 100 小时。我们在 5% 显著性水平上建立一个单尾 z 检验。假设为
H₀: μ = 100 小时
H₁: μ < 100 小时。
The test statistic is calculated using the sample mean:
z = (x̄ − μ) / (σ/√n) = (98.2 − 100) / (8/√50) ≈ −1.59
The critical value for a lower‑tail test at α = 0.05 is z_crit = −1.645. Since −1.59 > −1.645, the test statistic does not fall into the rejection region.
检验统计量使用样本均值计算:
z = (x̄ − μ) / (σ/√n) = (98.2 − 100) / (8/√50) ≈ −1.59
在 α = 0.05 下的下尾临界值为 z_crit = −1.645。由于 −1.59 > −1.645,检验统计量未落入拒绝域。
The p‑value, the probability of obtaining a z‑score as extreme as −1.59 under H₀, is Φ(−1.59) ≈ 0.0559. Because 0.0559 > 0.05, we do not reject H₀. There is insufficient evidence at the 5% level to conclude that the mean lifetime is less than 100 hours.
p 值为在 H₀ 下获得像 −1.59 这般极端 z 值的概率,Φ(−1.59) ≈ 0.0559。由于 0.0559 > 0.05,我们不拒绝 H₀。在 5% 显著性水平下,没有足够证据得出平均寿命低于 100 小时的结论。
9. Hypothesis Test on the Defect Proportion: Binomial Exact Test | 次品比例的假设检验:二项精确检验
Now we formally test the claim that the defect proportion is at most 5%. The hypotheses are
H₀: p = 0.05
H₁: p > 0.05 (one‑tailed, as an increased defect rate is a concern).
现在我们正式检验次品比例不超过 5% 的声称。假设为
H₀: p = 0.05
H₁: p > 0.05(单尾,因为次品率上升堪忧)。
We use the exact binomial distribution with n = 50, p₀ = 0.05. The p‑value is P(X ≥ 4 | p=0.05) = 1 − P(X ≤ 3). As computed earlier, P(X ≤ 3) ≈ 0.757, so p‑value ≈ 0.243. Since 0.243 > 0.05, we cannot reject H₀. The data do not provide sufficient evidence to dispute the company’s defect-rate claim at the 5% significance level.
我们使用基于 n = 50,p₀ = 0.05 的精确二项分布。p 值为 P(X ≥ 4 | p=0.05) = 1 − P(X ≤ 3)。如前计算,P(X ≤ 3) ≈ 0.757,故 p 值 ≈ 0.243。由于 0.243 > 0.05,无法拒绝 H₀。数据未在 5% 显著性水平上提供足够证据去质疑该公司的次品率声称。
10. Approximation Using the Normal Distribution | 使用正态近似
AS Level candidates often meet the idea that a binomial distribution can be approximated by a normal distribution when n is large and p is not too extreme. Here, np = 2.5 < 5, so the usual guideline (np ≥ 5 and nq ≥ 5) is not satisfied. Nevertheless, for illustration, we can apply the normal approximation with a continuity correction to see how it compares with the exact result.
AS 阶段的考生常会遇到这样的思想:当 n 较大且 p 不太极端时,二项分布可用正态分布近似。本例中 np = 2.5 < 5,故常用的指导原则(np ≥ 5 且 nq ≥ 5)未满足。但为说明起见,我们可应用带连续性校正的正态近似,观察其与精确结果的对比。
The approximating normal distribution is N(np, np(1−p)) = N(2.5, 2.375). To find P(X ≥ 4), we use X > 3.5 as the continuity‑corrected boundary. The z‑score is
z = (3.5 − 2.5) / √2.375 ≈ 1.0 / 1.541 ≈ 0.649
The right‑tail probability P(Z > 0.649) ≈ 1 − 0.7417 = 0.2583. This is reasonably close to the exact p‑value of 0.243, though the approximation is not highly accurate when np is small.
近似正态分布为 N(np, np(1−p)) = N(2.5, 2.375)。为了求 P(X ≥ 4),我们用 X > 3.5 作为连续性校正边界。z 分数为
z = (3.5 − 2.5) / √2.375 ≈ 1.0 / 1.541 ≈ 0.649
右尾概率 P(Z > 0.649) ≈ 1 − 0.7417 = 0.2583。与精确 p 值 0.243 相比还算接近,但在 np 较小时近似精度不高。
11. Type I and Type II Errors in Context | 情景中的第一类与第二类错误
In the mean lifetime test, we did not reject H₀. A Type I error would occur if we rejected H₀ when the true mean is indeed 100 hours; the probability of this is limited by α = 0.05. A Type II error would mean failing to reject H₀ when the true mean is actually lower than 100 hours. The power of the test depends on the true μ; for instance, if μ actually is 97 hours, the new z‑score for x̄ = 98.2 would be (98.2−97)/(8/√50) ≈ 1.06, making it harder to detect.
在均值寿命检验中,我们没有拒绝 H₀。若真实均值确为 100 小时
Published by TutorHao | Year 12 统计 Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导