7.3 Linear Regression, Correlation Analysis, and Design of Experiments (ANOVA)

Key Takeaways

  • Ordinary Least Squares (OLS) regression minimizes the sum of squared residuals (SSE), yielding slope β̂₁ = S_xy / S_xx and intercept β̂₀ = ȳ - β̂₁x̄, guaranteeing the fitted line passes through the centroid (x̄, ȳ).
  • The Pearson correlation coefficient r (-1 ≤ r ≤ 1) quantifies linear association, sharing the sign of β̂₁; its square, the coefficient of determination R² = SSR / SST, measures the proportion of total response variance explained by the model.
  • Model adequacy requires validating that residuals are independent, normally distributed with zero mean, and have constant variance (homoscedasticity); funnel patterns in residual vs. fitted plots signify heteroscedasticity.
  • One-way ANOVA partitions total variation into between-treatment (SS_treatments) and within-treatment error (SS_error); the omnibus test statistic F₀ = MS_treatments / MS_error tests the equality of k group means.
  • In 2^k full factorial experimental designs, k factors at 2 levels yield 2^k runs; main effects measure the average response change across factor levels, while interaction effects identify synergistic or antagonistic factor coupling.
Last updated: September 2026

Industrial and systems engineers frequently model empirical relationships between process variables, optimize multivariable systems, and isolate root causes of excessive manufacturing variability. Simple and multiple linear regression quantify how controllable process inputs drive performance outputs. Analysis of Variance (ANOVA) and Design of Experiments (DOE) provide structured, mathematically rigorous frameworks for evaluating multi-factor systems while minimizing required experimental trials. The NCEES FE Reference Handbook details these techniques under the Linear Regression and Analysis of Variance subsections. Mastering these methods is critical for both the FE Industrial exam and real-world process optimization.


1. Simple Linear Regression Model and Ordinary Least Squares (OLS)

Model Formulation

The simple linear regression model assumes that a continuous response variable $y$ is linearly related to a single independent regressor variable $x$ plus an unobservable random error term $\varepsilon$:

yi=β0+β1xi+εi,i=1,2,,ny_i = \beta_0 + \beta_1 x_i + \varepsilon_i, \quad i = 1, 2, \dots, n

where:

  • $\beta_0$: Population intercept (value of $y$ when $x = 0$)
  • $\beta_1$: Population slope (change in mean response per unit increase in $x$)
  • $\varepsilon_i$: Independent and identically distributed random error, $\varepsilon_i \sim \text{i.i.d. } N(0, \sigma^2)$

The Ordinary Least Squares (OLS) Criterion

OLS determines the parameter estimates $\hat{\beta}_0$ and $\hat{\beta}_1$ that minimize the Sum of Squared Errors (SSE) between observed responses $y_i$ and fitted responses $\hat{y}_i = \hat{\beta}_0 + \hat{\beta}_1 x_i$:

SSE=i=1nei2=i=1n(yiy^i)2=i=1n[yi(β^0+β^1xi)]2\text{SSE} = \sum_{i=1}^n e_i^2 = \sum_{i=1}^n (y_i - \hat{y}_i)^2 = \sum_{i=1}^n [y_i - (\hat{\beta}_0 + \hat{\beta}_1 x_i)]^2

Closed-Form Parameter Formulas

Taking partial derivatives with respect to $\hat{\beta}_0$ and $\hat{\beta}_1$ and setting them to zero yields the normal equations. Solving produces the standard NCEES formulas:

Sxx=i=1n(xixˉ)2=i=1nxi2(xi)2nS_{xx} = \sum_{i=1}^n (x_i - \bar{x})^2 = \sum_{i=1}^n x_i^2 - \frac{(\sum x_i)^2}{n} Syy=i=1n(yiyˉ)2=i=1nyi2(yi)2n=SSTS_{yy} = \sum_{i=1}^n (y_i - \bar{y})^2 = \sum_{i=1}^n y_i^2 - \frac{(\sum y_i)^2}{n} = \text{SST} Sxy=i=1n(xixˉ)(yiyˉ)=i=1nxiyi(xi)(yi)nS_{xy} = \sum_{i=1}^n (x_i - \bar{x})(y_i - \bar{y}) = \sum_{i=1}^n x_i y_i - \frac{(\sum x_i)(\sum y_i)}{n}

β^1=SxySxx\hat{\beta}_1 = \frac{S_{xy}}{S_{xx}} β^0=yˉβ^1xˉ\hat{\beta}_0 = \bar{y} - \hat{\beta}_1 \bar{x}

Fundamental Invariants:

  1. The fitted regression line always passes through the bivariate centroid $(\bar{x}, \bar{y})$.
  2. The sum of the raw residuals is identically zero: $\sum_{i=1}^n e_i = \sum_{i=1}^n (y_i - \hat{y}_i) = 0$.

2. Pearson Correlation and Coefficient of Determination (R²)

Pearson Product-Moment Correlation Coefficient ($r$)

The sample correlation coefficient $r$ measures the strength and direction of a linear relationship between two variables:

r=SxySxxSyy,1r+1r = \frac{S_{xy}}{\sqrt{S_{xx} S_{yy}}}, \quad -1 \le r \le +1

  • $r = +1$: Perfect positive linear association.
  • $r = -1$: Perfect negative linear association.
  • $r = 0$: No linear relationship (variables may still share a strong non-linear relationship).
  • Link to Regression Slope: $\hat{\beta}_1 = r \left(\frac{s_y}{s_x}\right)$. Consequently, the sign of $\hat{\beta}_1$ is always identical to the sign of $r$.

Partitioning Total Variation: SST = SSR + SSE

Total variability in the response variable ($y$) is partitioned into two mutually exclusive sums of squares:

SST=SSR+SSE\text{SST} = \text{SSR} + \text{SSE}

ComponentFormulaDegrees of FreedomMeaning
Total Sum of Squares (SST)$\sum (y_i - \bar{y})^2 = S_{yy}$$n - 1$Total variation of $y$ about $\bar{y}$
Regression Sum of Squares (SSR)$\sum (\hat{y}_i - \bar{y})^2 = \hat{\beta}1 S{xy}$$1$Variation explained by the linear relationship
Error Sum of Squares (SSE)$\sum (y_i - \hat{y}_i)^2 = \text{SST} - \text{SSR}$$n - 2$Unexplained residual noise

Coefficient of Determination ($R^2$)

R2=SSRSST=1SSESST=r2,0R21R^2 = \frac{\text{SSR}}{\text{SST}} = 1 - \frac{\text{SSE}}{\text{SST}} = r^2, \quad 0 \le R^2 \le 1

  • Interpretation: $R^2$ represents the proportion of total variation in the response variable $y$ that is explained by the fitted linear model with regressor $x$.
  • Caution: High $R^2$ does not imply causation, nor does it guarantee model validity if residuals exhibit non-random structure.

3. Residual Analysis and Model Adequacy Checking

Statistical inferences (CIs and hypothesis tests on $\beta_1$) rely on the Gauss-Markov assumptions: errors $\varepsilon_i$ must be independent, normally distributed, have zero mean, and possess constant variance $\sigma^2$ (homoscedasticity). Residuals $e_i = y_i - \hat{y}_i$ serve as the empirical proxies for $\varepsilon_i$.

  Residuals vs Fitted (Ideal)        Residuals vs Fitted (Heteroscedastic)      Residuals vs Fitted (Non-linear)
       ┌────────────────┐                  ┌────────────────┐                  ┌────────────────┐
       │  •   •   •   • │                  │        •    •  │                  │    •   •   •   │
  e    │•   •   •   •   │             e    │    •   •   •   │             e    │  •           • │
  0 ───┼────────────────┼───          0 ───┼────────────────┼───          0 ───┼────────────────┼───
       │  •   •   •   • │                  │    •   •   •   │                  │•               │
       │    •   •   •   │                  │        •    •  │                  │  •   •   •   • │
       └────────────────┘                  └────────────────┘                  └────────────────┘
              y_hat                               y_hat                               y_hat
  1. Residuals vs. Fitted Values ($\hat{y}_i$):
    • Random scatter band around zero: Assumptions satisfied.
    • Funnel / megaphone shape: Non-constant variance (heteroscedasticity). Requires a variance-stabilizing transform such as $\ln(y)$ or $\sqrt{y}$.
    • Curved / parabolic pattern: Non-linear relationship; indicates a higher-order term (e.g., $x^2$) has been omitted.
  2. Normal Probability Plot (Q-Q Plot) of Residuals: Plots sorted residuals against theoretical normal quantiles. Points should align tightly along a $45^\circ$ straight line; S-shaped deviations indicate heavy tails, while convex/concave curves indicate skewness.
  3. Residuals vs. Time / Run Order: Detects machine drift, ambient temperature shifts, or operator fatigue. Patterns indicate autocorrelation, violating the independence assumption.

4. Multiple Linear Regression (MLR) Basics

When $k$ predictor variables drive the response:

y=β0+β1x1+β2x2++βkxk+εy = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \dots + \beta_k x_k + \varepsilon

Adjusted $R^2$ ($R^2_{\text{adj}}$)

Adding additional predictor variables to an MLR model always increases the raw $R^2$ (or leaves it unchanged), even if the added variables are pure random noise. To prevent over-fitting, the adjusted $R^2$ penalizes model complexity:

Radj2=1SSE/(nk1)SST/(n1)=1(n1nk1)(1R2)R^2_{\text{adj}} = 1 - \frac{\text{SSE} / (n - k - 1)}{\text{SST} / (n - 1)} = 1 - \left( \frac{n - 1}{n - k - 1} \right)(1 - R^2)

If an added variable does not reduce $\text{SSE}$ by an amount sufficient to offset the loss of a degree of freedom, $R^2_{\text{adj}}$ will decrease.

Multicollinearity

Occurs when two or more predictor variables are highly correlated with each other. Multicollinearity does not reduce the overall predictive power of the model, but it inflates the standard errors of individual coefficients $\hat{\beta}_j$, making them unstable and leading to high $p$-values for variables that are actually important.


5. One-Way Analysis of Variance (ANOVA)

One-way ANOVA tests the null hypothesis that $k$ different treatment populations share the same mean:

H0:μ1=μ2==μkvs.H1:At least two treatment means differH_0: \mu_1 = \mu_2 = \dots = \mu_k \quad \text{vs.} \quad H_1: \text{At least two treatment means differ}

Partitioning the Sum of Squares

Let $k$ be the number of treatments, $n_i$ the sample size of treatment $i$, and $N = \sum_{i=1}^k n_i$ the total observations (for a balanced design with $n$ units per treatment, $N = kn$):

SStotal=SStreatments+SSerror\text{SS}_{\text{total}} = \text{SS}_{\text{treatments}} + \text{SS}_{\text{error}}

SStotal=i=1kj=1ni(yijyˉ)2\text{SS}_{\text{total}} = \sum_{i=1}^k \sum_{j=1}^{n_i} (y_{ij} - \bar{y}_{\cdot\cdot})^2 SStreatments=i=1kni(yˉiyˉ)2\text{SS}_{\text{treatments}} = \sum_{i=1}^k n_i (\bar{y}_{i\cdot} - \bar{y}_{\cdot\cdot})^2 SSerror=i=1kj=1ni(yijyˉi)2=SStotalSStreatments\text{SS}_{\text{error}} = \sum_{i=1}^k \sum_{j=1}^{n_i} (y_{ij} - \bar{y}_{i\cdot})^2 = \text{SS}_{\text{total}} - \text{SS}_{\text{treatments}}

The Standard One-Way ANOVA Table

Source of VariationSum of Squares (SS)Degrees of Freedom (df)Mean Square (MS)F-Statistic ($F_0$)
Treatments (Between)$\text{SS}_{\text{treatments}}$$k - 1$$\text{MS}{\text{treatments}} = \frac{\text{SS}{\text{treatments}}}{k - 1}$$F_0 = \frac{\text{MS}{\text{treatments}}}{\text{MS}{\text{error}}}$
Error (Within)$\text{SS}_{\text{error}}$$N - k$$\text{MS}{\text{error}} = \frac{\text{SS}{\text{error}}}{N - k}$
Total$\text{SS}_{\text{total}}$$N - 1$

The Decision Rule

Under $H_0$, the test statistic follows an $F$-distribution with $\nu_1 = k - 1$ numerator degrees of freedom and $\nu_2 = N - k$ denominator degrees of freedom:

If F0>Fα,k1,Nk,Reject H0\text{If } F_0 > F_{\alpha, \, k-1, \, N-k}, \quad \text{Reject } H_0


6. Design of Experiments (DOE) Foundations

Design of Experiments is an active, planned testing approach where input factors are deliberately varied to observe and quantify corresponding changes in the output response.

Core Terminology

  • Factor: An independent controllable variable (e.g., cutting speed, furnace temperature, feed rate).
  • Level: A specific value assigned to a factor (e.g., Temperature at $200^\circ\text{C}$ and $250^\circ\text{C}$).
  • Treatment: A specific combination of factor levels applied to an experimental run.
  • Experimental Unit: The smallest physical entity to which a treatment is applied (e.g., a single silicon wafer, a stamped metal bracket).

The Three Fundamental Principles of DOE

  1. Replication: Independent repetition of the basic experiment under identical treatment conditions. Replication provides an estimate of experimental error ($\text{MS}_{\text{error}}$) and increases the precision of effect estimates.
  2. Randomization: Allocating both the experimental units and the sequential run order randomly. Randomization balances out the effects of unobserved, uncontrolled nuisance variables (e.g., tool wear, ambient humidity).
  3. Blocking: Used to isolate and systematically eliminate variability caused by known, controllable nuisance factors that are not of primary interest (e.g., operator shift, raw material heat/lot). In a Randomized Complete Block Design (RCBD), each block contains a complete set of treatments.

7. $2^k$ Full Factorial Designs

In a $2^k$ factorial design, there are $k$ factors, each evaluated at exactly 2 levels: low (denoted by $-$ or $-1$) and high (denoted by $+$ or $+1$). The total number of required treatment runs is $N = 2^k$ (or $N = n \cdot 2^k$ with $n$ replicates).

Main Effects and Contrasts

The main effect of factor $A$ is the average change in response observed as factor $A$ transitions from its low level to its high level across all levels of all other factors:

Effect(A)=yˉA+yˉA=ContrastAn2k1\text{Effect}(A) = \bar{y}_{A^+} - \bar{y}_{A^-} = \frac{\text{Contrast}_A}{n \cdot 2^{k-1}}

where $\text{Contrast}_A = \sum (\pm y_i)$, using the signs from the design matrix column for factor $A$.

Interaction Effects

An interaction occurs when the effect of factor $A$ depends upon the level of factor $B$. The interaction column $AB$ is computed by taking the algebraic product of the signs in columns $A$ and $B$ ($+ \times + = +$, $+ \times - = -$).

               No Interaction (Parallel)                Strong Interaction (Non-Parallel)
                     Response (y)                                 Response (y)
                          │                                            │
               B_high ────┼─────────────────────           B_high ─────┼───────────────
                          │                                            │         ╲   ╱
               B_low  ────┼─────────────────────           B_low  ─────┼───────────╳───
                          │                                            │         ╱   ╲
                          └──────────┬──────────                       └──────────┬───
                                    Factor A                                     Factor A
  • Interaction Plot Rule: If the profile lines for different factor levels are parallel, no interaction exists. If the lines are non-parallel or cross, a strong interaction is present, and main effects cannot be interpreted in isolation.

8. Response Surface Methodology (RSM) Intuition

Response Surface Methodology (RSM) combines mathematical and statistical techniques to model and optimize systems where continuous input variables influence a continuous response (e.g., maximizing chemical yield or minimizing surface roughness).

  1. Phase 1 (Screening & First-Order Model): Fit a linear plane $y = \beta_0 + \sum \beta_i x_i + \varepsilon$ using a $2^k$ factorial design. Determine the path of steepest ascent (gradient vector) to move the operating window toward the optimum.
  2. Phase 2 (Optimization & Second-Order Model): When curvature is detected near the peak, augment the design with center points and axial (star) points to form a Central Composite Design (CCD) or a Box-Behnken design. Fit a full second-order polynomial model: y=β0+i=1kβixi+i=1kβiixi2+i<jβijxixj+εy = \beta_0 + \sum_{i=1}^k \beta_i x_i + \sum_{i=1}^k \beta_{ii} x_i^2 + \sum \sum_{i < j} \beta_{ij} x_i x_j + \varepsilon Solve for the stationary point (maximum, minimum, or saddle point) via canonical analysis.

9. Step-by-Step Worked Engineering Examples

Worked Example 7.3.1: Cutting Tool Feed Rate vs. Surface Roughness (OLS)

Problem: A manufacturing engineer evaluates the effect of CNC lathe feed rate ($x$, in $\text{mm/rev}$) on machined surface roughness ($y$, in $\mu\text{m}$). Data collected from $n = 5$ test coupons is summarized below: xi=1.00,yi=15.0,xi2=0.220,yi2=47.50,xiyi=3.20\sum x_i = 1.00, \quad \sum y_i = 15.0, \quad \sum x_i^2 = 0.220, \quad \sum y_i^2 = 47.50, \quad \sum x_i y_i = 3.20 Determine the least-squares regression line $\hat{y} = \hat{\beta}_0 + \hat{\beta}_1 x$, the correlation coefficient $r$, and the coefficient of determination $R^2$.

Solution:

  1. Compute Sample Means: xˉ=1.005=0.20 mm/rev,yˉ=15.05=3.00  μm\bar{x} = \frac{1.00}{5} = 0.20\text{ mm/rev}, \quad \bar{y} = \frac{15.0}{5} = 3.00\;\mu\text{m}
  2. Compute Sums of Squares: Sxx=xi2(xi)2n=0.220(1.00)25=0.2200.200=0.020S_{xx} = \sum x_i^2 - \frac{(\sum x_i)^2}{n} = 0.220 - \frac{(1.00)^2}{5} = 0.220 - 0.200 = 0.020 Syy=yi2(yi)2n=47.50(15.0)25=47.5045.00=2.50=SSTS_{yy} = \sum y_i^2 - \frac{(\sum y_i)^2}{n} = 47.50 - \frac{(15.0)^2}{5} = 47.50 - 45.00 = 2.50 = \text{SST} Sxy=xiyi(xi)(yi)n=3.20(1.00)(15.0)5=3.203.00=0.20S_{xy} = \sum x_i y_i - \frac{(\sum x_i)(\sum y_i)}{n} = 3.20 - \frac{(1.00)(15.0)}{5} = 3.20 - 3.00 = 0.20
  3. Compute Slope $\hat{\beta}_1$ and Intercept $\hat{\beta}_0$: β^1=SxySxx=0.200.020=10.0  μm/(mm/rev)\hat{\beta}_1 = \frac{S_{xy}}{S_{xx}} = \frac{0.20}{0.020} = 10.0\;\mu\text{m}/(\text{mm/rev}) β^0=yˉβ^1xˉ=3.00(10.0)(0.20)=3.002.00=1.00  μm\hat{\beta}_0 = \bar{y} - \hat{\beta}_1 \bar{x} = 3.00 - (10.0)(0.20) = 3.00 - 2.00 = 1.00\;\mu\text{m} Fitted Model:y^=1.00+10.0x\text{Fitted Model:} \quad \hat{y} = 1.00 + 10.0 x
  4. Compute Correlation $r$ and $R^2$: r=SxySxxSyy=0.200.020×2.50=0.200.050=0.200.22361+0.8944r = \frac{S_{xy}}{\sqrt{S_{xx} S_{yy}}} = \frac{0.20}{\sqrt{0.020 \times 2.50}} = \frac{0.20}{\sqrt{0.050}} = \frac{0.20}{0.22361} \approx +0.8944 R2=r2=(0.8944)2=0.80(80.0%)R^2 = r^2 = (0.8944)^2 = 0.80 \quad (80.0\%) Interpretation: $80.0%$ of the total variation in surface roughness is explained by feed rate. Sanity check: because $|r| \le 1$ always, $S_{xy}^2$ can never exceed $S_{xx} S_{yy}$. Here $0.20^2 = 0.040 < 0.020 \times 2.50 = 0.050$, so the summary statistics are internally consistent. If a computed $|r|$ exceeds 1, the input sums contain an error.

Worked Example 7.3.2: One-Way ANOVA on Packaging Line Takt Times

Problem: An industrial engineering department audits $k = 3$ automated cartoning machines. A balanced sample of $n = 5$ cycle time trials is recorded for each machine ($N = 15$ total runs). The data yields: SStreatments=48.0,SStotal=84.0\text{SS}_{\text{treatments}} = 48.0, \quad \text{SS}_{\text{total}} = 84.0 Construct the complete ANOVA table and determine whether machine cycle time means differ at $\alpha = 0.05$ ($F_{0.05, , 2, , 12} = 3.89$).

Solution:

  1. Calculate Error Sum of Squares: SSerror=SStotalSStreatments=84.048.0=36.0\text{SS}_{\text{error}} = \text{SS}_{\text{total}} - \text{SS}_{\text{treatments}} = 84.0 - 48.0 = 36.0
  2. Determine Degrees of Freedom: dftreatments=k1=31=2\text{df}_{\text{treatments}} = k - 1 = 3 - 1 = 2 dferror=Nk=153=12\text{df}_{\text{error}} = N - k = 15 - 3 = 12 dftotal=N1=151=14\text{df}_{\text{total}} = N - 1 = 15 - 1 = 14
  3. Compute Mean Squares: MStreatments=SStreatmentsdftreatments=48.02=24.0\text{MS}_{\text{treatments}} = \frac{\text{SS}_{\text{treatments}}}{\text{df}_{\text{treatments}}} = \frac{48.0}{2} = 24.0 MSerror=SSerrordferror=36.012=3.0\text{MS}_{\text{error}} = \frac{\text{SS}_{\text{error}}}{\text{df}_{\text{error}}} = \frac{36.0}{12} = 3.0
  4. Compute Test Statistic $F_0$: F0=MStreatmentsMSerror=24.03.0=8.00F_0 = \frac{\text{MS}_{\text{treatments}}}{\text{MS}_{\text{error}}} = \frac{24.0}{3.0} = 8.00
  5. Decision and Conclusion:
    • Critical value: $F_{0.05, , 2, , 12} = 3.89$.
    • Because $F_0 = 8.00 > 3.89$, we reject $H_0$.
    • Conclusion: There is statistically significant evidence at $\alpha = 0.05$ that the mean cycle times of the cartoning machines differ.

10. NCEES Reference Handbook Tips & Realistic Exam Traps

  • ANOVA Degrees of Freedom Balance: On incomplete ANOVA table problems, always verify the additive identity of degrees of freedom: $\text{df}{\text{total}} = \text{df}{\text{treatments}} + \text{df}_{\text{error}}$. For $k$ treatments and $N$ total observations, this is always $(N - 1) = (k - 1) + (N - k)$.
  • The Extrapolation Trap: A regression model is strictly valid only across the experimental range of the regressor variable $[x_{\min}, x_{\max}]$. Predicting response values beyond this interval is an invalid extrapolation that assumes linearity persists without empirical evidence.
  • $R^2$ vs. $r$ Sign Trap: If given $R^2 = 0.81$, $r$ is either $+0.90$ or $-0.90$. You must look at the slope $\hat{\beta}1$ or the sign of $S{xy}$ to determine whether $r$ is positive or negative.
  • Interaction Overrides Main Effects: If an interaction effect ($AB$) is statistically significant, you cannot interpret the main effects ($A$ or $B$) in isolation. The optimal setting of factor $A$ depends directly on the level of factor $B$.
Test Your Knowledge

An industrial engineer conducts a one-way ANOVA to compare the mean cycle times across k = 4 semi-automated packaging lines. A balanced sample of n = 6 production runs is measured for each line (total sample size N = 24). The calculation yields SS_treatments = 180.0 and SS_total = 340.0. What is the error sum of squares (SS_error), the error degrees of freedom (df_error), and the resulting test statistic F₀?

A
B
C
D
Test Your Knowledge

In an electronics manufacturing plant, an engineer models wire bond pull strength (y, in grams) as a function of ultrasonic bonding power (x, in watts) using simple linear regression based on n = 10 test coupons. The summary statistics are S_xx = 40.0, S_yy = 250.0, and S_xy = 80.0. What is the estimated regression slope β̂₁ and the coefficient of determination R²?

A
B
C
D
Test Your Knowledge

A process engineer designs a full factorial experiment to evaluate the effect of temperature and pressure on chemical vapor deposition coating thickness. Because the test runs will span across two distinct shifts with different operators, the engineer groups the experimental runs so that each shift executes a complete, balanced replicate of the treatments. Which primary experimental design technique is being utilized to eliminate shift-to-shift operator variation from the experimental error?

A
B
C
D