Batch capability analysis: within- and between-batch variation

Updated

A batch capability analysis assesses a process that makes product in batches (blends, lots, heats, kettles) and samples several units from each batch. It splits the total variation into a within-batch part and a between-batch part, estimates capability from their sum, and shows how each batch sits against the specification. It answers two questions at once: will the next batch be capable, and which past batches came close to a limit.

When to use it

  • Pharmaceutical, chemical, food and metallurgical processes, where each batch is mixed or treated as a unit and then sampled several times.
  • You want to know whether improving uniformity within a batch or consistency between batches matters more.
  • Batches are a random sample of what the process produces, without a meaningful time order between them (for subgroups in time order, see between/within capability).
  • You have at least 5 to 6 batches with several samples each; more batches give a far better between-batch estimate than more samples per batch.

How it works

There are several ways to analyze batch data; this article uses the common one-way random-effects model. Each value is the overall mean plus a batch effect plus a within-batch error, both random:

xᵢⱼ = μ + bᵢ + eᵢⱼ, Var(bᵢ) = σ_B², Var(eᵢⱼ) = σ_W²

A one-way ANOVA of the values by batch gives the mean squares between (MS_B) and within (MS_W). With k batches of n samples each:

σ_W² = MS_W σ_B² = max(0, (MS_B − MS_W) / n) σ_total = √(σ_B² + σ_W²)

The process capability uses σ_total: Ppk = min(USL − x̄, x̄ − LSL) / (3σ_total). The batch-by-batch view compares each batch mean with the limits using σ_W, which shows how much room each batch leaves for its own units: Ppk_batch = min(USL − x̄ᵢ, x̄ᵢ − LSL) / (3σ_W).

Example

A tablet press makes six batches of a product with an assay specification of 95.0 to 105.0% of label claim. The lab tests five tablets from each batch:

BatchAssay (% of label claim)MeanStDev
199.7, 100.6, 100.2, 99.5, 100.8100.160.56
299.1, 99.1, 98.7, 99.7, 99.399.180.36
399.9, 98.9, 99.5, 98.7, 100.199.420.61
497.8, 97.9, 97.9, 96.8, 98.297.720.54
5103.1, 100.1, 100.0, 100.2, 102.1101.101.42
6100.9, 101.7, 101.4, 101.0, 101.1101.220.33
Tablet assay by batch98100102Assay (% of label claim)123456
Tablet assay by batch

The ANOVA:

SourceDFSSMSFP
Batch543.4568.69116.21< 0.001
Within2412.8640.536
Total2956.320

Variance components: σ_W² = 0.536, so σ_W = 0.732; σ_B² = (8.691 − 0.536) / 5 = 1.631, so σ_B = 1.277; σ_total = √(1.631 + 0.536) = 1.472. The grand mean is 99.80.

BasisσPpkExpected PPM
Within batches only0.7322.19< 0.1
Total (between + within)1.4721.09762

Batch by batch, with σ_W = 0.732: batch 1: 2.20, batch 2: 1.90, batch 3: 2.01, batch 4: 1.24, batch 5: 1.78, batch 6: 1.72.

How to read the results

  • Between-batch variation dominates. σ_B² is 75% of the total variance. The tablets in a batch are uniform; the batches differ from one another. Improvement effort belongs in batch-to-batch consistency (raw-material potency, blend time, dispensing), not in uniformity within a batch.
  • The process is not capable over many batches. A Ppk of 1.09 for the total means that a future batch could land close to a limit. The within-only figure of 2.19 describes a single batch and should not be reported as process capability.
  • Batch 4 is the weak point. Its mean of 97.72 leaves the least room to the lower limit (Ppk_batch 1.24). Look at its records first.
  • Batch 5 spreads more. Its standard deviation (1.42) is two to four times that of the others. A test for equal variances would show whether that is real; if so, something in that batch's mixing deserves attention, and the pooled σ_W hides it.

Common mistakes

  • Treating all values as one sample. The 30 tablets are not 30 independent draws; they are 6 batches. Pooling them makes the sample look larger than it is for between-batch questions.
  • Sampling many tablets from few batches. Five tablets from each of 6 batches gives only 5 degrees of freedom for σ_B. Ten batches of three tablets would estimate it far better.
  • Ignoring a negative variance estimate. If MS_B is smaller than MS_W, the between component is set to zero. That means the batches did not differ detectably, not that they are identical.
  • Confusing batch capability with release testing. Each batch can pass its release test while the process as a whole is barely capable.

Frequently asked questions

How is batch capability different from between/within capability?

Both add a between component to the within variation. Between/within capability estimates it from moving ranges of subgroup means in time order; batch capability treats batches as a random sample and estimates it with ANOVA. For time-ordered batches, both should give similar results.

What if the number of samples differs between batches?

The ANOVA still works, but the simple formula for σ_B² uses an effective sample size in place of n. A mixed effects model fitted by restricted maximum likelihood handles unequal sizes directly.

Should I use σ_total or the overall standard deviation?

They estimate the same thing in different ways. Here the overall standard deviation of the 30 values is 1.394, against σ_total = 1.472. With few batches, σ_total is the better choice because it weights each batch correctly rather than each tablet.

Try it with your own data

StatLab SPC is free, open-source statistics for engineers. It runs in your browser, works offline, and never uploads your data.

Open StatLab