PharmaCalc

Pharmaceutical Calculation Suite

← All calculator guides Open calculator →

X̄-R/S Control Chart

Monitor process location and spread from rational subgroups — X̄-R for small subgroups, X̄-S for larger ones, with Western Electric rules 1–5 flagged point by point.

Shewhart Charts WE Rules 1–5 n = 2–25 SPC
Get the right chart for your subgroup size, with every rule violation flagged.
Free demo — no account needed. Every run produces a GMP PDF report.
Open the X̄-R / X̄-S Chart calculator →
Open the X̄-R / X̄-S Chart calculator →
🏭

Industry Use

Subgrouped control charts in pharmaceutical operations

X̄-R and X̄-S charts monitor a process sampled in rational subgroups — typically 3–5 items taken together at regular intervals: 5 tablets from a press every hour, 3 fill-weight checks per run. The X̄ chart tracks process location; the companion R (range) or S (standard deviation) chart tracks within-subgroup spread. Because control limits are built from within-subgroup variation only, the charts respond quickly to special causes between subgroups.

R or S? The range chart is the classical hand-calculation choice and works well for small subgroups (n ≤ 8 or so); the S chart uses every observation and is preferred for larger subgroups or software-computed charts. This calculator supports both and picks constants for any n from 2 to 25.

Typical applications: tablet compression monitoring, fill-weight sampling, dissolution with multiple units per timepoint, and CPV Stage 3 continued process verification.

ASQ CSSBB Handbook (App. 4 constants) Western Electric Handbook (1956) FDA Process Validation (2011)

Calculation Explanation

Control limits for X̄-R and X̄-S charts
X̄ chart (limits from R̄ or S̄)
UCL/LCL = X̿ ± A₂·R̄   (X̄-R)   ·   UCL/LCL = X̿ ± A₃·S̄   (X̄-S)
R chart
UCL_R = D₄·R̄   ·   LCL_R = D₃·R̄   ·   CL = R̄
S chart
UCL_S = B₄·S̄   ·   LCL_S = B₃·S̄   ·   CL = S̄
Process σ estimate (feeds capability work)
σ̂ = R̄ / d₂   or   σ̂ = S̄ / c₄

Constants for n = 5: A₂ = 0.577, D₃ = 0, D₄ = 2.114, A₃ = 1.427, B₃ = 0, B₄ = 2.089, d₂ = 2.326, c₄ = 0.9400. The calculator holds the full n = 2–25 table (standard SPC constants as tabulated in the ASQ CSSBB Handbook, Appendices 4 and 6; published tables differ occasionally in the last printed digit).

Western Electric rules flagged by this calculator (applied to both charts): 1 — a point beyond ±3σ; 2 — 9 consecutive points on one side of the centerline; 3 — 6 consecutive points steadily increasing or decreasing; 4 — 2 of 3 consecutive points beyond ±2σ on the same side; 5 — 4 of 5 consecutive points beyond ±1σ on the same side. Each rule can be switched on or off to match your SOP. Naming note: Rule 2's 9-point run criterion follows Nelson (1984) — the default in most SPC software; the original Western Electric Handbook (1956) rule is 8 consecutive points, which is what PharmaCalc's I-MR calculator applies. The rule numbering also differs between the two calculators (here Rules 2–3 are the run/trend tests and 4–5 the zone tests; on I-MR, Rules 2–3 are the zone tests). Map your SOP to the rule definitions, not the rule numbers.

📋

Variable Definitions

Symbols, units, and descriptions
Symbol Name Units Description
xᵢⱼIndividual measurementproduct unitsMeasurement j within subgroup i.
X̄ᵢ, X̿Subgroup mean, grand meanproduct unitsX̿ (average of subgroup means) is the X̄-chart centerline.
Rᵢ, R̄Subgroup range, average rangeproduct unitsR̄ is the R-chart centerline and drives X̄-R limits.
sᵢ, S̄Subgroup SD, average SDproduct unitsS̄ is the S-chart centerline and drives X̄-S limits.
A₂, D₃, D₄R-chart constantsFunctions of n; convert R̄ into control limits.
A₃, B₃, B₄S-chart constantsFunctions of n; convert S̄ into control limits.
d₂, c₄σ-estimate constantsσ̂ = R̄/d₂ or S̄/c₄ — the short-term σ used for capability.
n, kSubgroup size, subgroup countcountn items per subgroup; k subgroups. Collect ≥ 20–25 subgroups before fixing limits.
📖

Step-by-Step Tutorial

Worked example — tablet fill weight X̄-R chart

Scenario: Tablet compression monitoring, subgroup size n = 5, five subgroups of fill weights (mg). (Five subgroups keeps the arithmetic followable — production charts should have ≥ 20–25 subgroups before limits are fixed; until then treat limits as trial limits.)

  1. Subgroup means and ranges.
    Data (mg)
    S1: 500.1, 499.8, 500.5, 500.0, 500.2 → X̄₁ = 500.12, R₁ = 0.7
    S2: 499.5, 499.9, 500.1, 500.3, 499.8 → X̄₂ = 499.92, R₂ = 0.8
    S3: 500.2, 500.8, 500.4, 500.0, 500.6 → X̄₃ = 500.40, R₃ = 0.8
    S4: 499.8, 500.2, 500.0, 500.5, 499.9 → X̄₄ = 500.08, R₄ = 0.7
    S5: 499.6, 500.1, 500.2, 499.9, 500.3 → X̄₅ = 500.02, R₅ = 0.7
  2. Centerlines.
    Calculation
    X̿ = 2500.54 / 5 = 500.108 mg  ·  R̄ = 3.7 / 5 = 0.74 mg
  3. X̄-chart limits (A₂ = 0.577 for n = 5).
    Calculation
    UCL = 500.108 + 0.577 × 0.74 = 500.53 mg
    LCL = 500.108 − 0.577 × 0.74 = 499.68 mg
  4. R-chart limits (D₃ = 0, D₄ = 2.114).
    Calculation
    UCL_R = 2.114 × 0.74 = 1.56 mg · LCL_R = 0
  5. Apply the rules. All five means fall inside [499.68, 500.53]; all ranges inside [0, 1.56]; no rule 2–5 pattern in five points. In control — and σ̂ = R̄/d₂ = 0.74/2.326 = 0.318 mg is the short-term σ available for capability work.
✓ Process in statistical control — X̄ limits [499.68, 500.53] mg, R limit 1.56 mg, σ̂ = 0.318 mg (trial limits until ≥ 20 subgroups)
⚠️

Assumptions and Limitations

What the calculation presumes — and what it does not cover
📚

References

Primary sources for this guide
Stop rebuilding this in a spreadsheet

PharmaCalc returns the right chart for your subgroup size, with every rule violation flagged. It is computed server-side against the published method and written into a GMP PDF report with the inputs, formula chain, references, document control and signature pages — traceable to the software release that produced it.

Open the X̄-R / X̄-S Chart calculator — free demo
No account required to try it · Browse all 23 calculator guides
Open the X̄-R / X̄-S Chart calculator →