Sub topic 12
Confirming with a controlled trial or designed experiment
Earlier chapters tested a suspected root cause against data the process had already produced. That kind of data can show that an input X and an output Y move together. It cannot rule out a third factor driving both. This chapter covers the step that does: changing X on purpose, under controlled conditions, and watching whether Y responds.
This chapter assumes you can run a two-sample t-test, read a p-value, and recognize a confounder, as covered in the previous chapters. It also assumes you know the Lean Six Sigma terms Y (the process output) and X (a process input).
When observation is not enough
Observational data comes from the process as it runs. You did not choose which units ran on which shift or which machine. Because those choices were made for other reasons, they can be tangled up with the cause you suspect.
A confirmatory experiment breaks that tangle. You decide which units get which level of X, and you make that decision in a way that does not depend on anything else about the units. If Y still shifts, X is much more likely to be the cause.
Not every suspected cause needs an experiment. The table below gives a working guide.
| Situation | Typical decision |
|---|---|
| Strong effect, a plausible mechanism, and no credible confounders in the stratified data | Observational evidence may be enough. Document it and move on. |
| Effect is real but confounders cannot be excluded | Run a controlled trial. |
| Changing X is expensive, risky, or irreversible | Look for a cheaper trial first, such as a small pilot, or strengthen the observational case. |
| X cannot be changed ethically or physically (weather, supplier history) | Rely on careful stratification and matched comparisons. Say plainly that the causal claim is weaker. |
| Several suspected causes may interact | Use a designed experiment that varies them together. |
Controlled trial versus designed experiment
A controlled trial changes one factor and compares two conditions, such as the old setup and the suspected setup. A designed experiment (DOE) changes several factors in a planned pattern, so you can estimate each factor's effect and whether the factors interact. Both rest on the same three principles.
- Control. Hold constant everything you can: material lot, operator, ambient conditions, measurement method. Whatever you cannot hold constant, record.
- Randomization. Assign units, or the order of runs, to conditions by chance. Randomization spreads unknown influences, such as tool wear through the day, evenly across conditions on average, so they cannot line up with X.
- Replication. Repeat each condition enough times to estimate the run-to-run variation. Without replicates you cannot tell an effect from noise.
Two further tools are often added. Blocking groups similar runs, for example one block per material lot, and compares conditions within each block. Blinding hides the condition from the people measuring or judging the result, which matters when the measurement involves judgment, such as visual inspection.
Workflow
The diagram shows how the trial fits between the earlier analysis and the final decision.
Step 1: restate the prediction
Reuse the measurable prediction from earlier in the tutorial. For example: "If the new fixture setup causes longer cycle times, then cycle time on the new setup will average at least 0.5 minutes more than on the old setup, with all other conditions equal." Write the minimum difference that would matter to the process. You need it to size the trial.
Step 2: size the trial
The sample size depends on three things: the smallest difference you care about, the run-to-run standard deviation, and the error risks you accept. The standard deviation can come from the observational data you already have. A smaller target difference or a noisier process needs more runs. Pick the sample size before running the trial, and do not stop the moment the p-value looks good.
Step 3: randomize the run order
Do not run all the old-setup units first and all the suspect-setup units afterward. Any drift over time, such as warm-up, tool wear, or an operator getting tired, would then be mixed up with the setup. The script below creates a random run order with equal numbers of each condition. Setting the seed makes the plan reproducible, so you can record it in the trial protocol.
import numpy as np
rng = np.random.default_rng(42)
# 10 runs per condition, shuffled into a random run order
runs = np.array(["old"] * 10 + ["suspect"] * 10)
rng.shuffle(runs)
for order, setup in enumerate(runs, start=1):
print(f"Run {order:2d}: {setup}")Step 4: run the trial and record everything
Follow the protocol. Record the actual condition each run received, not just the planned one. Also record anything unusual: a tool change, a substitute operator, a stoppage. If a run deviates from the plan, note it and decide in advance how deviations will be handled in the analysis. Do not delete inconvenient runs afterward.
Analyzing a two-condition trial
For a trial with two conditions and a continuous response, the analysis is the same Welch t-test you used on observational data. What differs is how far you can trust the answer. Because assignment was random, a significant difference is much harder to attribute to a confounder.
Report an effect size and an interval together with the p-value. A p-value says whether a difference is detectable. The estimated difference, with its confidence interval, says whether it is large enough to matter and whether it matches your prediction.
A designed experiment with two factors
Suppose the setup is not the only suspect. A material lot might also affect cycle time, and you want to know whether the two act separately or together. A 2×2 full factorial runs every combination of two levels of two factors: old or new setup, and lot L1 or L2. That gives four conditions, each replicated four times.
From the results you can estimate three quantities.
- Main effect of a factor: the average change in Y when that factor moves from its first level to its second, averaged over the other factor.
- Interaction: whether the effect of one factor depends on the level of the other.
The script below computes these by hand from a balanced data set, so you can see what the numbers mean.
import pandas as pd
df = pd.DataFrame({
"setup": ["old"] * 8 + ["new"] * 8,
"lot": (["L1"] * 4 + ["L2"] * 4) * 2,
"cycle": [
12.0, 12.2, 11.9, 12.1, # old, L1
12.4, 12.3, 12.5, 12.2, # old, L2
13.0, 13.2, 12.9, 13.1, # new, L1
13.4, 13.3, 13.5, 13.2, # new, L2
],
})
# Mean cycle time in each of the four cells
cells = df.groupby(["setup", "lot"])["cycle"].mean().unstack()
print(cells)
# Main effects: difference between factor-level means, averaged over the other factor
setup_effect = (df[df.setup == "new"]["cycle"].mean()
- df[df.setup == "old"]["cycle"].mean())
lot_effect = (df[df.lot == "L2"]["cycle"].mean()
- df[df.lot == "L1"]["cycle"].mean())
# Interaction: does the lot effect differ between the two setups?
interaction = ((cells.loc["new", "L2"] - cells.loc["new", "L1"])
- (cells.loc["old", "L2"] - cells.loc["old", "L1"]))
print(f"Setup main effect: {setup_effect:.2f} min")
print(f"Lot main effect: {lot_effect:.2f} min")
print(f"Interaction: {interaction:.2f} min")In this data the new setup adds about 1.0 minute, the lot adds about 0.3 minute, and the interaction is about zero. Both factors matter, and they act independently. The setup effect is the larger one, so the suspected cause is supported, and the lot is a separate, smaller contributor. In the original observational data these two factors could have been mixed together, which is exactly the problem the designed experiment resolves.
To get p-values for the main effects and interaction, fit an ANOVA model (for example with statsmodels). The effects above are the quantities that model estimates.
Edge cases and common errors
- Changing too many things at once. If the "new setup" also came with a new operator and new material, a difference cannot be assigned to any one of them. Vary the suspected X, and hold the rest fixed or include them as factors.
- No true replicates. Measuring the same unit five times is repeated measurement, not replication. Replicates are independent runs of the whole condition. Otherwise the variation you estimate is too small and the p-value too optimistic.
- Unrepresentative conditions. A trial run on a quiet weekend with the best operator may not predict normal production. Run it under conditions the process normally sees, or state the limits of the result.
- Hidden time trends. Even with randomization, a strong drift inflates noise. A run chart of the response in run order, with the condition marked, will expose it.
- Practical limits of randomization. Some factors are hard to change, such as oven temperature. Then you randomize in blocks, with all runs at one temperature before the change, and the analysis must account for that restriction. Ask a statistician before relying on a standard t-test in that case.
- Unclear stopping rule. Looking at the p-value after each run and stopping when it dips below 0.05 inflates the false-positive rate well above 5%. Fix the sample size beforehand.
- Ignoring the Measure-phase checks. A trial with a poor measurement system gives a poor answer. Confirm gauge quality first, as in the data-quality chapter.
Deciding what happens next
Document the trial protocol, the randomization plan, any deviations, the estimated effect with its interval, and the test result. Then decide.
- Accept the cause when the effect appears in the predicted direction and the interval clears the minimum meaningful difference. Move to Improve, and plan to confirm that the fix removes the problem.
- Revise the hypothesis when the effect is real but smaller than predicted, or appears only under some conditions. Another cause may be contributing, or an interaction may be at work.
- Reject the cause when a well-powered trial shows no meaningful effect. Return to the fishbone diagram or the stratified data for the next suspect.
A "no effect" result is only convincing if the trial had enough power to detect the effect you cared about. If it did not, call the result inconclusive rather than rejecting the cause.
Exercise
A team suspects that a new fixture makes cycle times longer. They run all 10 old-fixture units on Monday and all 10 new-fixture units on Tuesday. The new fixture averages 0.8 minutes longer, and the t-test gives p = 0.01. Why is this weaker evidence than it looks, and how would you redesign the trial?
Show answer
Fixture is completely confounded with day. Anything that differs between Monday and Tuesday (operator, material lot, machine warm-up, temperature) could explain the 0.8-minute difference, and the t-test cannot separate them. Redesign by randomizing the run order so that both fixtures run on both days, for example 5 old and 5 new each day in random order. Hold material lot and operator constant or block on them, record the actual condition of every run, and fix the sample size in advance from the minimum difference that matters and the known standard deviation.
Exercise
In a 2×2 factorial experiment, the lot effect is +0.5 minutes under the old setup and +0.5 minutes under the new setup. What is the interaction, and what does it tell you?
Show answer
The interaction is 0.5 − 0.5 = 0 minutes. The lot has the same effect regardless of the setup, so the two factors act independently, and you can report their main effects separately.