Advancing QE Skills (37) | Regression and Correlation: From Scatter Plots to Prediction Windows
A manufacturing company produces an injection-molded structural component with a snap-fit. During the design verification phase, the snap-fit pull-off force fluctuates significantly, ranging from 168N to 236N, while the drawing specifies 150~220N. The R&D engineer has only 14 sets of trial data, spanning 5 candidate variables: wall thickness, material moisture content, snap-fit fillet, assembly temperature, and raw material batch. The project team ran a multiple regression analysis using software, with an R² of 0.89, and decided: "Set the wall thickness to 1.20±0.05, control the moisture content below 0.4%, and ignore the rest." Three months later, during small-scale production, the proportion of pull-off forces exceeding the upper limit rose to 6%. During the post-mortem analysis, two issues were identified: first, the model included 3 variables that were highly collinear, with conflicting coefficient signs; second, they used the "confidence interval of the mean" to verify the specifications, while the actual shipped products were individual pieces. This was not a software error but a misunderstanding of correlation as causation and fitting as prediction.
1. Key Principles: Three Things Must Be Separated
The correlation coefficient indicates "changing together," not "one causing the other." r=0.82 only indicates the strength of the co-variation between two variables, while r²=0.67 suggests that about 67% of the variation in Y can be explained by the linear term of X, with the remaining 33% coming from other sources. To claim causation, at least three conditions must be met: the cause precedes the effect in time, confounding variables can be ruled out, and Y changes when X is altered (conduct a small-scale validation experiment). If any of these conditions are missing, only "correlation" can be stated, not "because... so..."
Regression coefficients should be read with intervals. If the wall thickness coefficient is 18N/0.1mm and the 95% confidence interval is 12~24N, it means "the direction is certain, but the magnitude has uncertainty." If the interval is −3~39N, crossing zero, then this variable is unproven with the current data. The width of the interval is directly determined by the sample size and the dispersion of X, which is more important to consider than the p-value.
Prediction should distinguish between two types of intervals. The confidence interval (CI) of the mean only describes "where the regression line is," while the prediction interval (PI) of an individual piece describes "where the next piece will fall":
- CI = ŷ ± t·s·√(1/n + (x₀−x̄)²/Sxx)
- PI = ŷ ± t·s·√(1 + 1/n + (x₀−x̄)²/Sxx)
The difference lies in the "1" under the square root. When n=14, the PI is typically three times wider than the CI. Using the CI to verify specifications is equivalent to assuming "each piece equals the mean," which was the direct cause of the failure in the above case.
The significance threshold for r in small samples is much higher than intuition suggests. For a two-tailed α=0.05:
| Sample Size n | Significance Threshold for |r| | |---|---| | 10 | 0.632 | | 20 | 0.444 | | 30 | 0.361 | | 50 | 0.279 |
When n=8 and r=0.70, it may seem strong, but the p-value is still on the edge of 0.05. Insufficient sample size often leads to the illusion of correlation.
2. Practical Steps: From Scatter Plots to Usable Windows
Step 1: Calculate the sample size before modeling. Rule of thumb: each independent variable should have at least 10~15 observations, and the measured range of independent variables should cover the design window, with 10% margin at each end. For 5 variables, including 2 interaction terms, at least (5+2+1)×10=80 sets are needed. With only 14 sets, the correct approach is to reduce to 1~2 main effect variables or conduct additional trials, rather than forcing all 5 variables into the model. Criterion: when the degrees of freedom (n−p−1) are less than 10, the model can only be used for exploration, not for setting windows.
Step 2: Examine the correlation matrix and handle collinearity. Keep only one variable from pairs with |r|>0.9 (the one that is easier to control and measure more accurately). After modeling, calculate the VIF: a single variable VIF>5 suggests collinearity, and VIF>10 must be stopped or combined. In the above case, the VIF for wall thickness and fillet is 8.6, with coefficient signs opposite to those in single-factor experiments, a typical symptom of collinearity—individual coefficients cannot be interpreted as "effect size," only the overall model can be considered.
Step 3: Diagnose residuals in four aspects, and revisit if any fail.
- Normality: Anderson-Darling test p>0.05 (or residuals roughly follow the line in a probability plot);
- Homoscedasticity: no funnel or trumpet shape in the residuals vs. fitted values plot;
- Independence: Durbin-Watson statistic between 1.5~2.5; in the case, the value is 0.9, indicating batch drift, which requires adding batch dummy variables or stratified modeling;
- Influential points: check points with Cook's D > 1 or > 4/n individually, retain those with a process explanation and document them, and isolate and retest those without a clear explanation; do not delete them directly.
Step 4: Review coefficient intervals and effect sizes to decide which variables to keep. Retention criteria: p<0.05, 95% confidence interval does not include 0, and the standardized coefficient is not the smallest in the model. When all three variables are significant, prioritize those that are adjustable, measurable, and have low adjustment costs—the window should ultimately be set on parameters that can be executed.
Step 5: Use PI to set the window, not the regression line. For example, at a wall thickness of 1.20mm and moisture content of 0.4%, the point prediction is 195N, s=12N, n=14, t₀.₉₇₅,₁₁≈2.20, and the PI half-width ≈ 2.20×12×√(1+1/14)≈27N, resulting in an individual piece interval of 168~222N. The upper limit of 222N exceeds the specification of 220N. Recalculating point by point reveals that the PI upper limit exceeds the specification when the wall thickness exceeds 1.17mm. Therefore, the window is narrowed from "1.20±0.05" to "1.15~1.17," and moisture content is treated as a noise factor in the tolerance design. Criterion: the acceptance standard for the window is that the PI falls entirely within the specification, not that the mean line is centered within the specification.
3. Common Pitfalls
Pitfall 1: Writing correlation as causation with certainty. "Increased moisture content leads to decreased pull-off force"—if all high-moisture samples come from the same supplier batch, the true cause is the batch, and moisture content is just a bystander. Solution: check for confounding (stratify and see if the relationship holds within each batch) or conduct a 3-level small experiment for validation.
Pitfall 2: Assuming the model is usable because R² is high. R² can be inflated by three things: extrapolation (artificially widening the X range), collinearity (variables explaining each other), and outliers (one or two extreme points pulling the line). A model with R²=0.89 but a funnel-shaped residual plot and DW=0.9 can be used for description but not for setting windows. Criterion: R² is only a reference; the four residual diagnostics are the entry criteria.
Pitfall 3: Using CI instead of PI. This is the most expensive mistake in setting design windows. With a CI half-width of 9N and a PI half-width of 27N, the difference of 18N directly translates to the out-of-spec rate in production. The report must clearly state which type of interval is used.
Pitfall 4: Estimating the nonconforming rate using in-sample fitting error. No nonconforming products in 14 sets of data does not mean the nonconforming rate is 0—when n=14, the true nonconforming rate at 95% confidence could be as high as 19%. To estimate the nonconforming rate, the sample size should be at least three times the "expected number of nonconforming pieces ÷ expected nonconforming rate."
Pitfall 5: Removing unfavorable points without documentation. Removal must have three things: criteria (3σ, box plot, Grubbs), written justification and approval, and a comparison of the model and capability before and after removal. A report that only states "outliers have been removed" is equivalent to no analysis in a review.
4. Self-Check List
- Each independent variable has more than 10~15 observations, residual degrees of freedom ≥10, and the range of independent variables covers the design window with a 10% margin at each end.
- The correlation matrix and VIF have been verified, |r|>0.9 variable pairs have been selected, and variables with VIF>10 have been stopped or combined.
- Each of the four residual diagnostics (normality, homoscedasticity, independence, influential points) has a conclusion, and the Durbin-Watson statistic falls between 1.5~2.5.
- Each retained variable's coefficient is accompanied by a 95% confidence interval, and the interval does not include 0.
- The window is set using the prediction interval of individual pieces, not the confidence interval of the mean, and there is a point-by-point comparison of "PI upper/lower limit vs. specification upper/lower limit."
Correlation only indicates co-variation; regression must be able to predict.
Knowledge code: 6.4.3
Version: v20261030
Author: QTank QTank is dedicated to providing systematic professional knowledge, methodologies, and practical tools for quality management practitioners, helping companies continuously improve their quality capabilities.