Correlation and regression
Measuring how variables move together, fitting a line or a model, R-squared, residuals, and the trap of correlation vs causation.
Correlation and regression describe relationships between variables: does part thickness change with mold temperature, and by how much?
Correlation
The Pearson correlation coefficient r runs from −1 to +1. Values near ±1 mean a strong straight-line relationship; near 0 means no straight-line relationship (there could still be a curve). Spearman's correlation uses ranks and catches monotonic curves.
Correlation is not causation. Ice cream sales and drownings rise together because of summer. In a plant, two measurements may both follow ambient temperature. Use designed experiments to prove cause.
Simple linear regression
Fits by least squares. is the change in y per unit of x.
- R²: the share of variation in y explained by the model. Adjusted R² penalizes extra terms.
- p-value of a coefficient: whether that term is different from zero.
- Residuals: actual minus predicted. Plot them; they should look like random noise with constant spread.
Multiple regression and more
- Multiple regression: several predictors at once. Watch for multicollinearity (predictors correlated with each other; check VIF, values above 5 to 10 are a concern).
- Polynomial terms: for curvature.
- Logistic regression: for pass/fail outcomes.
- Stepwise and best subsets: help choose terms, but confirm with process knowledge.
Questions and answers
R² is 0.45. Is the model useless?
Not necessarily. A factor that explains 45% of the variation can be very important. But predictions for single parts will be imprecise. Check whether the residuals hide a pattern you could model.
Can I use the model outside the range of my data?
Extrapolation is risky. The relationship may bend or break outside the range you tested.
