Shewhart Variable Control Charts (X-bar and R) and Process Capability Analysis (Cp, Cpk)
by Rao Statistics · Last updated on 2 Nov 2026 · 5.3 Control Charts
Rigorous derivation of 3-sigma control boundaries, Western Electric out-of-control run rules, and defect rate quantification
Learning Objective
By the end of this lesson: Construct X-bar and R charts for subgroup size n=5, verify statistical control under 3-sigma boundaries, and calculate process capability indices Cp and Cpk against engineering tolerances.
Statistical Theory & Assumptions
A manufacturing process operating under statistical control exhibits only common (random) cause variation. Shewhart variable control charts utilize subgroup averages and ranges to establish empirical 3-sigma upper and lower control limits (UCL and LCL). Process capability compares intrinsic 6-sigma process spread with customer tolerance specifications.
Assumptions
- Normal Distribution: Within-subgroup quality characteristic is normally distributed.
- Rational Subgrouping: Variations within subgroups reflect only short-term random error.
- Independent Subgroups: Observations between successive rational subgroups are independent.
Where for subgroup size n=5, and estimates intrinsic process standard deviation.
Worked Dataset & Variables
Precision Shaft Diameter Machining Records: Ten rational subgroups of n=5 precision shafts measured in millimeters with specification limits 50.00 ± 0.15 mm. (sample size n = 50).
| Variable | Type | Description |
|---|---|---|
| subgroup_id | Integer | Subgroup index |
| x_bar | Numeric | Subgroup average (mm) |
| range_r | Numeric | Subgroup range (mm) |
| subgroup_id | x_bar | range_r |
|---|---|---|
| 1 | 50.02 | 0.08 |
| 2 | 49.99 | 0.07 |
| 3 | 50.01 | 0.09 |
| 4 | 50.04 | 0.06 |
| 5 | 49.98 | 0.08 |
Software Procedure (R, Python & Excel)
# Shewhart X-bar and R Chart in R (qcc package)
# library(qcc)
x_bars <- c(50.02, 49.99, 50.01, 50.04, 49.98, 50.03, 50.00, 50.01, 49.99, 50.02)
r_vals <- c(0.08, 0.07, 0.09, 0.06, 0.08, 0.07, 0.09, 0.08, 0.06, 0.08)
x_double_bar <- mean(x_bars)
r_bar <- mean(r_vals)
A2 <- 0.577
ucl_x <- x_double_bar + A2 * r_bar
lcl_x <- x_double_bar - A2 * r_bar
cat("X-bar Center:", x_double_bar, "UCL:", round(ucl_x, 4), "LCL:", round(lcl_x, 4))Numerical Results
Process is in statistical control with grand mean 50.009 mm. Estimated mm. Capability index Cp = 1.530 and Cpk = 1.439.
| Statistic | Value | Note |
|---|---|---|
| Grand Process Mean (X̿) | 50.009 mm | |
| Average Subgroup Range (R̄) | 0.076 mm | |
| Capability Ratio (Cp) | 1.530 | Exceeds benchmark 1.33 |
| Centering Index (Cpk) | 1.439 | Capable & centered |
Interpretation & Decision Rule
Formal conclusion: The machining line is operating under strict statistical process control with Cpk = 1.439 > 1.33, delivering an expected fallout rate of under 8 parts per million (PPM).
Decision rule: A process is certified capable when Cpk >= 1.33 for existing production lines and Cpk >= 1.67 for new safety-critical components.
Practical significance: Both X-bar and R charts show zero points outside control limits and no non-random trends, validating release for high-volume serial assembly.
Practice Files
Download: two_sample_ttest_model_template.xlsx (Excel Template, 22 KB)