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.
UCLXˉ=Xˉˉ+A2Rˉ,Cp=USL−LSL6σ^,Cpk=min⁡(USL−Xˉˉ3σ^,Xˉˉ−LSL3σ^)\text{UCL}_{\bar{X}} = \bar{\bar{X}} + A_2 \bar{R}, \quad C_p = \frac{\text{USL} - \text{LSL}}{6\hat{\sigma}}, \quad C_{pk} = \min\left( \frac{\text{USL} - \bar{\bar{X}}}{3\hat{\sigma}}, \frac{\bar{\bar{X}} - \text{LSL}}{3\hat{\sigma}} \right)

Where A2=0.577A_2 = 0.577 for subgroup size n=5, and σ^=Rˉ/d2\hat{\sigma} = \bar{R} / d_2 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).

Data dictionary
VariableTypeDescription
subgroup_idIntegerSubgroup index
x_barNumericSubgroup average (mm)
range_rNumericSubgroup range (mm)
Sample observations
subgroup_idx_barrange_r
150.020.08
249.990.07
350.010.09
450.040.06
549.980.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 σ^=0.0327\hat{\sigma} = 0.0327 mm. Capability index Cp = 1.530 and Cpk = 1.439.

Key results
StatisticValueNote
Grand Process Mean (X̿)50.009 mm
Average Subgroup Range (R̄)0.076 mm
Capability Ratio (Cp)1.530Exceeds benchmark 1.33
Centering Index (Cpk)1.439Capable & 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)

You might also like

← 5.3 Control Charts