在质量和制造领域,统计测试是为决策提供客观证据的唯一方法。它们有助于识别流程中的变化,区分随机波动和实际问题。在工程领域,统计有助于识别系统性能的模式、异常值和故障源,确保以数据为导向进行决策。通过严格分析实验结果,工程师可以验证产品设计和制造流程,在实施前发现潜在问题。这种系统化的方法可降低意外故障的风险,并通过确保可靠性和符合国际安全标准来提高整体安全性。.
本篇文章将回顾生产和制造过程中使用的主要统计检验方法。 全面质量管理 (全面质量管理).
注:由于也涉及工程、研究和科学,以下 2 项统计测试和分析
- 相关性分析: 测量两个变量之间关系的强度和方向(例如:......)、, 培生集团 相关系数)。.
- 回归分析: 从简单的线性回归到多元回归,研究变量(如输入因素和过程输出)之间的关系。
这里不包括这些算法,而是专门介绍工程学的 10 种主要算法。
正态性检验

在统计检验领域,许多常用的统计方法(t 检验、方差分析、线性回归等)都假定数据是正态/高斯分布的(或残差/误差是正态的)。违反这一假设会使结果不可靠:P 值可能会误导人,置信区间可能会出错,I/II 类错误的风险也会增加。请注意,有些检验(如单因素方差分析)可以很好地处理非正态分布。
注意:如果您的数据不符合正态性,请参阅下面的实际案例,您可能需要使用非参数检验(如 Mann-Whitney U 检验或 Kruskal-Wallis 检验),这些检验不假定数据符合正态性,或者对数据进行转换,这不在本篇文章的讨论范围之内。
虽然有多种统计检验方法,但在此我们将详细介绍 Shapiro-Wilk 检验方法,该方法尤其适用于小样本量,通常 n < 50,但也可用于多达 2000 个样本。
顺便提一下,其他常见的正态性检验:
- Kolmogorov-Smirnov (K-S) 检验(带 Lilliefors 校正):样本量较大时效果更好,但灵敏度不如 Shapiro-Wilk,尤其是在小数据集上
- 安德森-达林检验:适用于所有样本量,对分布的尾部(极值)更敏感,对检测极值偏离正态性更强。
如何进行 Shapiro-Wilk 正态性检验
1.计算或计算 Shapiro-Wilk 检验统计量 (W): [latex]W = \frac{left(\sum_{i=1}^{n} a_i x_{(i)}\right)^2}{\sum_{i=1}^{n} (x_i - \bar{x})^2}[/latex] Note: as the calculation of the [latex]a_i[/latex] coefficients is nontrivial and generally requires a table or algorithm, which is why the Shapiro-Wilk test is nearly always computed by software such as R, Python’s SciPy, MS Excel add-ons or other dedicated softwares. 如需手动计算,请参见本页 提供了最多 50 个样本的所有 [latex]a_i[/latex] 系数和 p 值。 W 值介于 0 和 1 之间(W = 1:完全正态性。W<1:离 1 越远,数据越不正常)。 2.W 是不够的。它需要与相应的 p 值结合起来才能得到置信水平。在 Shapiro-Wilk 表中,在 在 n 个样本量的行中,查找与计算出的 W 值最接近的值,并获取其对应的 顶部的 p 值 | 分子表示加权有序样本值的平方和。 分母是与样本平均数的平方差之和(即样本方差,按 (n-1) 缩放)。 [latex]x_{(i)}[/latex] = 第 i 阶统计量(即样本中第 i 个最小值) [latex]x_i[/latex] = 第 i 个观测值 [latex]\bar{x}[/latex] = 样本平均数 [latex]a_i[/latex] = 根据标准正态分布((N(0,1))样本阶次统计量的均值、方差和协方差计算得出的常量(权重),且仅取决于 n(样本数)。 n = 样本数量 |
3. 结果 如果 p 值大于所选的α水平(例如 0.05),则有统计证据表明所测试的数据是正态分布的。 | |
对于正态性检验,通常建议将数字方法与图形方法(如亨利线、Q-Q 图或直方图)相结合:
心智非正态分布!
虽然正态分布/高斯分布是最常见的情况,但不应自动假定为正态分布/高斯分布。日常的反例有
- 个人之间的财富和收入分配。它遵循帕累托(幂律)分布,偏斜的 "长尾 "是非常富有的个人。
- 一个国家的城市人口规模遵循齐普夫定律(幂律),即几个非常大的城市和许多小城镇。
- 地震的震级和频率呈幂律/古腾堡-里克特分布:小地震常见,大地震罕见。
- 金融市场的每日价格变化或回报:肥尾/重尾分布,而非高斯分布;大偏差出现的频率高于正态分布的预测。
- 语言中的词频,正如上述城市人口一样,遵循齐普夫定律(幂律):经常使用的词很少,大多数词都很罕见。
- 互联网流量/网站受欢迎程度:幂律/长尾:有些网站的点击率高达数百万次,而大多数网站的点击率却很低。
- 计算机系统上的文件大小:对数正态分布或幂律分布,大文件少,小文件多。
- 人类寿命/长寿:右斜(可以用 威布尔 或 Gompertz 分布),而不是正态分布;更多的人死于年龄较大。
- 社交网络连接遵循幂律:少数用户的连接数多,多数用户的连接数少。
其中大多数的特点是 "少大多小",是幂律、重尾、指数或对数正态分布的特征,而不是高斯分布的对称形状。
t 检验(学生 t 检验)
t 检验(又称 "学生 t")由威廉-西利-戈塞特(William Sealy Gosset)于 1908 年以 "学生 "的笔名提出,是一种统计检验,用于在样本量较小且群体方差未知的情况下比较均值。它侧重于比较两个群体的均值,是制造业中最常用的检验之一。

目的是 t 检验可帮助工程师和质量专业人员确定两组平均值之间或样本平均值与已知标准之间是否存在统计学意义上的显著差异。它通常用于假设检验,以评估流程变更或产品修改是否对产品性能产生影响。 引领 真正的改进或差异,超出了偶然的预期。
行业实例:
- 在汽车制造领域,t 检验可用于比较来自两个不同供应商的钢材的抗拉强度,以确保质量的一致性。
- 在制药领域,t 检验用于分析新生产工艺生产的药片的平均重量是否与标准有显著差异。
- 在电子学中,工程师可能会使用 t 检验来验证一个 设计变更 于 电路板 从而明显改善电阻。.
如何进行学生 t 检验
t 检验有许多变体;这里的例子将侧重于所谓的 “双样本 t 检验 ”的 “非配对 ”版本,即比较两个不同生产批次的样本。.
- 说明你的零假设和备择假设;在本例中,“均值之间没有差异 ”与 “存在差异 ”的对比是这样的”
- 收集两个生产批次的比较数据并计算
- 2 个样本均值 [latex]\bar{X} = \frac{1}{n_1}\sum_{i=1}^{n_1}X_i[/latex] 和 [latex]\bar{Y} = \frac{1}{n_2}\sum_{j=1}^{n_2}Y_j[/latex]
- 计算 2 个样本方差:[latex]S_X^2 = \frac{1}{n_1-1} \sum_{i=1}^{n_1} (X_i - \bar{X})^2[/latex] 和 [latex]S_Y^2 = \frac{1}{n_2-1} \sum_{j=1}^{n_2} (Y_j - \bar{Y})^2[/latex]
- 样本量。.
- 计算检验统计量。虽然该方法假定两个样本都是独立的,两个样本都来自正态分布的群体,但仍有两种情况:
- 如果假设方差相等 (集合 “t 检验):集合方差: [latex]S_p^2 = \frac{ (n_1-1)S_X^2 + (n_2-1)S_Y^2 }{ n_1 + n_2 - 2 }[/latex]
测试统计量: [latex]t = \frac{ \bar{X} - \bar{Y}}{ S_p \sqrt{ \frac{1}{n_1}+ \frac{1}{n_2}}}[/latex] - 如果方差不等 (韦尔奇 t 检验):检验统计量: [latex]t = \frac{ \bar{X} - \bar{Y}}{ \sqrt{ \frac{S_X^2}{n_1}+ \frac{S_Y^2}{n_2}}}[/latex] 自由度(近似,Welch-Satterthwaite):[latex]df = \frac{left( \frac{S_X^2}{n_1} + \frac{S_Y^2}{n_2} \right)^2}{ \frac{ (S_X^2 / n_1)^2 }{ n_1 - 1 }+ \frac{ (S_Y^2 / n_2)^2 }{ n_2 - 1 }}[/latex]
- 如果假设方差相等 (集合 “t 检验):集合方差: [latex]S_p^2 = \frac{ (n_1-1)S_X^2 + (n_2-1)S_Y^2 }{ n_1 + n_2 - 2 }[/latex]
- 使用计算出的 ( t ) 和自由度(等方差时为 [latex]n_1+n_2-2[/latex],或韦尔奇公式)从 t 分布中查找或计算 p 值(取决于是单尾检验还是双尾检验)。.
- 结果 根据您选择的置信水平和自由度,将计算出的 t 值与统计表中的临界 t 值进行比较;或者使用软件计算 p 值。如果 t 统计量超过临界值或 p 值低于临界值(通常为 0.05),则拒绝零假设。.
链接到 t 检验临界值表
The F-Test
The F-test, introduced by statistician Ronald A. Fisher in the early 20th century, is used to compare the variability (variance) between two sets of data, to assess if their population variances are significantly different. In quality and engineering, it often helps determine if process changes or different machines produce consistent results or if new methods affect product variability. Often a preliminary step before applying t-tests and ANOVA on larger comparisons.
目的是 the F-Test is used to confirm if two processes or samples have the same level of variation, which supports quality control decisions and process improvements. It helps engineers identify if changes (e.g., new machines, suppliers, or materials) impact the consistency or quality of a product.
Industry Examples
- Manufacturing: comparing the dimensional variances of parts produced by two different machines to ensure both machines produce consistently within quality standards.
- Supplier Evaluation: comparing the strength variability of raw materials from two different suppliers to decide if one supplier provides more consistent quality.
- Quality Improvement: testing if a process improvement (like a new calibration method) has reduced the variability in final product weight compared to the old method.
How-to the F-Test
- Collect two sets of sample data (e.g., measurements from process A and process B).
- Calculate the variance for each sample group A and B.
- Divide the larger variance by the smaller variance to get the F-value.
- 结果 compare this F-value to a critical value from the F-distribution table based on sample sizes and the desired confidence level; if the calculated F-value is greater, the variances are significantly different. In statistical tests, the variance ratio tests, the degrees of freedom (DOF) associated with each group is the quantity of samples minus one (note that this is different for an ANOVA result comparison).
F-distribution table: link to the F-distribution table up to 15×15 DOF (and online F critical calculator for bigger DOF)
方差分析
While the F-test above refers broadly to any statistical test that uses the F-distribution and is used to compare variances or ratios of variances between two or more groups, the ANOVA is a variant that compares the means of three or more groups to see if at least one is significantly different. The ANOVA test was also developed by Ronald Fisher in the 1920s as a statistical tool for agricultural experiments.
目的是 the Analysis of Variance (ANOVA) is to determine whether there are statistically significant differences between the means of three or more independent groups. In quality, engineering and particularly in 实验设计(DOE), it helps identify which factors or processes have a significant impact on product performance or output, aiding robust decision-making and process improvement.
例如:
- In pharmaceutical production, ANOVA can help compare the effects of different formulation processes on the efficacy of a drug.
- In electronics, it is used to test if the variance in circuit board failure rates is due to different batches of raw materials.
How-to ANOVA in Brief
1. Define the groups or treatments you want to compare and collect data from each group. Calculate
2. Use these values to calculate the F-statistic (see on the right), which is the ratio of variance between groups to the variance within groups. 3. Compare F-statistic to a critical value from the F-distribution table at a chosen significance level (like 0.05). 4. Result: if the F-statistic exceeds the critical value, you conclude that there are significant differences among group means. | The F-statistic: The F corresponds to the Mean Square Between Groups (MSB) divided by Mean Square Within Groups (MSW) Practically: [latex]F = \frac{ \frac{SSB}{k-1} }{ \frac{SSW}{N-k} }[/latex] SSB = Sum of Squares Between Groups |
The Chi-Square Test
The Chi-Square Test, introduced by Karl Pearson in 1900, revolutionized statistical hypothesis testing by providing a method to determine if there is a significant difference between expected and observed frequencies in categorical data. In quality and engineering, it helps assess whether deviations in a process or product attributes occur by chance or suggest a systemic issue.
目的是 the Chi-Square Test checks if the differences between observed and expected results in quality measurements are due to random variation or indicate a specific problem that needs addressing.
Practical examples in industry
- Manufacturing Defects: checking if the distribution of defective products across different shifts or machines is uniform, and whether certain shifts have a significantly higher defect rate.
- Supplier Quality: comparing the quality performance (e.g., pass/fail rates) of components from multiple suppliers to determine if one supplier’s parts are statistically more likely to fail.
- Customer Complaints: analyzing whether the types or frequency of customer complaints are randomly distributed throughout the year, or are associated with specific times, products, or regions.
How to do the chi-square test
- Collect observed data and determine the expected frequencies for each category under the null hypothesis.
- Use the Chi-Square formula: Χ² = Σ[(O – E)² / E] where O is observed, E is expected.
- Compare the calculated Chi-Square value against a critical value from the Chi-Square table with the appropriate degrees of freedom.
- 结果 if the value exceeds the table value, conclude there is a statistically significant difference.
Link to the chi-square critical values table
Chi-Square Full Example: Fairness of a Dice
| 我 | Oi | Ei | Oi−Ei | (Oi−Ei)2 |
| 1 | 5 | 10 | −5 | 25 |
| 2 | 8 | 10 | −2 | 4 |
| 3 | 9 | 10 | −1 | 1 |
| 4 | 8 | 10 | −2 | 4 |
| 5 | 10 | 10 | 0 | 0 |
| 6 | 20 | 10 | 10 | 100 |
| Sum | 134 | |||
This full example is taken from Wikipedia Chi-square article.
Experience: a 6-sided die is thrown 60 times. The number of times it lands face up on 1, 2, 3, 4, 5, 6 is 5, 8, 9, 8, 10 and 20, respectively.
Question: is the die biased, according to the Pearson’s chi-squared test at a significance level of 95% and/or 99%?
The null hypothesis is that the die is unbiased, hence each number is expected to occur the same number of times, in this case, 60/n = 10.
The outcomes can be tabulated as on the right:
| Degrees of freedom | Probability less than the critical value | ||||
|---|---|---|---|---|---|
| 0.90 | 0.95 | 0.975 | 0.99 | 0.999 | |
| 5 | 9.236 | 11.070 | 12.833 | 15.086 | 20.515 |
Looking at an upper-tail critical values of chi-square distribution table (table linked in the how-to above), the tabular value refers to the sum of the squared variables each divided by the expected outcomes.
For the present example, this means χ2=25/10+4/10+1/10+4/10+0/10+100/10=13.4
Conclusion of test: this 13.4 is the experimental result whose unlikeliness (with a fair die) we wish to estimate, with a significance or confidence between 97.5% and 99%
Process Capability (Cp, Cpk, Pp, Ppk)

Not a statistical test per se, these 4 ratios assess how well a process meets specifications, thus becoming a critical tool for maintaining and improving quality standards in manufacturing.
Process capability analysis originated in the early 20th century alongside the rise of statistical quality control in manufacturing, pioneered by figures like Walter Shewhart. Its methods evolved through the growth of 六西格玛 and Total Quality Management (TQM) in the late 20th century as a cornerstone of modern quality engineering.
目的是 process capability analysis assesses how well a process can produce output within specified limits (tolerances). It quantifies the variability of a process relative to design specifications and determines the likelihood of producing defective products. The analysis helps identify opportunities for process improvement and ensures products consistently meet customer requirements.
Cp, Cpk and Statistical Tests in Industry
- Automotive manufacturing: statistical tests and these 4 ratios are used to check whether the diameter of engine pistons remains consistently within tight tolerance limits, ensuring compatibility and reducing engine failures.
- Pharmaceutical industry: applied to verify that the fill weight of tablets or capsules consistently meets regulatory and quality standards, minimizing underdose or overdose risks.
- 半导体 manufacturing: employed to monitor the thickness of wafer coatings, ensuring reliability and performance in microchip production.
How to calculate Cp, Cpk, Pp and Ppk
Cp: Process Capability
| [latex]Cp = \frac{USL – LSL}{6\sigma}[/latex] | USL = Upper Specification Limit LSL = Lower Specification Limit σ = standard deviation (typically estimated from within-subgroup variation) |
Cpk: Process Capability Index
[latex]Cpk = \min\left(\frac{USL – \mu}{3\sigma}, \frac{\mu – LSL}{3\sigma}\right)[/latex] | [latex]\mu[/latex] = process mean |
Pp: Process Performance
[latex]Pp = \frac{USL – LSL}{6s}[/latex] | [latex]s[/latex] = overall standard deviation (includes both within and between subgroup variations; used over a longer period) |
Ppk: Process Performance Index
[latex]Ppk = \min\left(\frac{USL – \bar{x}}{3s}, \frac{\bar{x} – LSL}{3s}\right)[/latex] | [latex]\bar{x}[/latex] = overall mean |
How to Conclude with Cp, Cpk, Pp, Ppk Values
- Cp, Pp: if >1, the process has the potential to meet specifications; values ≥1.33 are generally considered capable, depending o your industry and the criticality of your exact application
- Cpk, Ppk: these reflect how centered the process is within specs; the closer Cpk/Ppk are to Cp/Pp, the more centered the process.
- If Cpk or Ppk <1, a significant portion of output is likely outside the specification; process improvement is needed.
- A higher index indicates a more capable (and usually, higher quality) process.
Conclusion & Pitfalls
Statistical tests are powerful tools in data analysis, but their use demands both strong theoretical understanding and critical real-world judgment and adaptation, far from just a statistical software installation or QMS rules.
- 理解假设和electing the right test:每个统计检验都有一组基本假设(例如,数据的正态性、方差相等、观测值的独立性)。如果这些假设被违反或 an inappropriate test chosen, the results of the test may be invalid or misleading.
- Real-world messiness & business context matters: industrial data often violate test assumptions (e.g., non-normality, autocorrelation). Blindly applying textbook tests can result in completely misleading analyses.
- Data quality issues: measurement errors, outliers, and missing data are common in industrial statistical tests and must be addressed and documented before testing.
For product design so as for quality, put your effort where needed: “Sometimes, results are statistically significant but have negligible practical impact, or vice versa”
External Links on Statistical Tests for Quality
国际标准
(将鼠标悬停在链接上即可查看内容描述)
常用术语表
Analysis of Variance (ANOVA): 一种统计方法,通过分析组内和组间方差来确定三个或三个以上独立组的均值之间是否存在显著差异。它评估一个或多个因素对因变量的影响。
Degrees Of Freedom (DOF): 定义机械系统或统计模型配置的独立参数数量的度量,指示系统在不违反约束的情况下可以移动或变化的方式的数量。
Design of Experiments (DOE): 一种系统的方法,用于计划、实施、分析和解释受控测试,以评估多个变量对响应变量的影响,从而实现对流程或产品的优化和理解。
Design of Experiment (DOE): 一种系统的方法,用于规划、实施和分析受控测试,以评估多个变量对响应变量的影响,从而有助于识别最佳条件和因素之间的相互作用。
Process Capability Index (Cpk): 一种统计测量方法,用于量化过程在指定限制内产生输出的能力,指示过程平均值与最接近的规格限制之间的关系,并根据过程变化进行调整。
Process Performance Index (Ppk): 一种统计指标,用于量化过程符合规格限值的程度,使用过程平均值和标准差计算得出。它表示过程在规定限值范围内产生输出的能力,同时考虑了变异性和中心性。
Quality Management System (QMS): 一套结构化的流程、程序和责任体系,旨在确保产品和服务的质量始终如一、促进持续改进并满足客户和监管要求。
Solid-State Battery (SSB): 这种电池技术采用固态电解质而非液态或凝胶电解质,具有更高的能量密度、更佳的安全性和更长的使用寿命。与传统电池相比,它通常具有更强的热稳定性,并能降低泄漏或燃烧的风险。
Total quality management (TQM): 一种通过客户满意度实现长期成功的管理方法,让组织的所有成员参与流程、产品和服务的持续改进,以提高质量和性能。

















