Regression Analysis

Polynomial regression (degree 1–3, interactions), Exponential, Logarithmic, Power

Overview

Regression describes the relation between a dependent variable (Y, response) and one or more independent variables (X, predictors) through a mathematical model. Where correlation only asks "do they move together?", regression delivers an equation that lets Y be predicted or understood.

Simple linear regression: Simple linear regression — one X, one Y. Model: Y = β₀ + β₁·X + ε. β₀ is the intercept, β₁ the slope, ε the residual error. The most common entry point.

Multiple regression: Multiple linear regression adds several X variables: Y = β₀ + β₁·X₁ + β₂·X₂ + … + ε. Allows estimating the effect of each variable while holding the others constant.

R² (coefficient of determination): R² — share of Y variation explained by the model. 0 = model explains nothing, 1 = perfect explanation. R² = 0.85 means: 85% of Y variation is explained by the X.

Adjusted R²: Adjusted R² corrects R² for the number of variables. Important in multiple regression: adding X always raises R², but adjusted R² only rises if they truly contribute.

p-value per coefficient: Tests whether a coefficient differs significantly from 0. p < 0.05 → the variable demonstrably contributes to the model.

Residuals: Residuals — difference between observed Y and predicted Y. A good regression has randomly scattered residuals without pattern — patterns indicate missed effects.

Approach

  • Before regression, make scatter plots — do the data fit a linear model?
  • Fit the model (pick Y and X, run the software).
  • Check R² and p-values — does the model make sense at all?
  • Inspect residuals: random scatter around zero, no patterns, no funnels.
  • Apply the model to new data — does it actually predict what it should?
  • For multiple regression, check multicollinearity (VIF) and drop redundant X.

Interpretation

A high R² is not automatically a good model. More important: do predictions hold for values outside the training data, are residuals well-behaved, and does the model make domain sense? A model with R² = 0.99 and systematic residuals is worth less than one with R² = 0.7 and clean residuals.

Predictions outside the observed X range (extrapolation) are risky. The model "knows" nothing about what it has not seen — the linear relation may have ended long ago.

Pitfalls

Linear model for nonlinear data: A curved relation is only roughly captured by a straight line. Residuals show clear curvature — that is the signal to try a nonlinear or transformed model.

Multicollinearity: With multicollinearity — when two X are strongly correlated — the model cannot separate their individual effects; coefficients become unstable and hard to interpret. VIF > 5 is a warning sign.

Overfitting: Overfitting — a model with too many X for too few observations fits random noise. R² looks great, new data disappoints. Rule of thumb: at least 10 observations per coefficient.

Heteroscedasticity ignored: With heteroscedasticity — residual scatter grows with X (funnel shape) — standard errors are biased and p-values and confidence intervals lie. Transformation or weighted regression helps.

Extrapolation: Using the model outside the training range — risky because nothing has been validated there. Treat predictions as reliable only inside the observed X range.

Causal language on observational data: A regression on observational data describes relations but does not prove causation. Causal claims need an experiment (DoE) or very strong arguments.

Examples

This module ships with the following example datasets — load any of them in the app with a single click.

Pizza Delivery Time (multiple linear regression) — Project template
30 pizza deliveries with distance (km), traffic level (1–5) and measured delivery time (min). Linear model Time ≈ 5 + 2.5·distance + 1.2·traffic — textbook dataset for multiple linear regression with high R².
Motor Trials (multicollinearity) — Project template
30 motor trials with rpm and torque as predictors, power as response. Torque ≈ 0.04·rpm — predictors are highly collinear, VIF spikes. Textbook multicollinearity case.
Fuel Consumption with Outliers — Project template
30 vehicle measurements speed → fuel consumption. Two deliberate outliers (rows 6 and 23) drop R² compared to the clean linear fit. Textbook case for residual diagnostics and outlier detection.
Bacterial Growth (exponential model) — Project template
30 germ counts over 15 hours, the count grows by about 25 % per hour. The exponential model y = a·e^(bx) captures the curved trend where a straight line misses systematically.
Learning Curve (logarithmic model) — Project template
30 repetitions of an assembly task with output per hour. Performance rises quickly at first and levels off later. The logarithmic model y = a + b·ln(x) describes this saturation.
Pipe Pressure Drop (power model) — Project template
30 measurements of pressure drop at rising flow, Δp grows roughly with v^1.8. The power model y = a·x^b returns the exponent directly as a coefficient.
Yield from a Designed Experiment (DoE term preset) — Project template
Full-factorial 2² experiment with temperature and pressure, replicated three times, yield as response. The term preset from the experiment planner (main effects and interaction) is applied on the first run; aliased terms would trigger a note.

Available in the following cycles

  • DMAIC: Improve
  • DMADV: Design
  • 8D: D5 — Corrective Actions