Session 3: Factorial Analysis

DoE Implementation - Design, Analysis & Interpretation

🎯 Learning Objectives

Design Construction: Build 2^k and 3^k factorial designs using standard order and randomization principles
Effect Calculation: Calculate main effects and interactions step-by-step with pharmaceutical examples
ANOVA Analysis: Interpret factorial ANOVA tables and build predictive models
Practical Application: Apply factorial designs to tablet formulation optimization

🏗️ Part 1: 2^k Factorial Design Constructor

Design Matrix & Standard Order

Let's Think Step-by-Step: Building a 2³ Design

Step 1: We have 3 factors (A, B, C), each at 2 levels (-1 = Low, +1 = High)

Step 2: Total runs needed = 2³ = 8 experiments

Step 3: We use standard order based on binary counting (000, 001, 010, 011, 100, 101, 110, 111)

Step 4: Convert binary to factorial notation: 0 → -1, 1 → +1

Pharmaceutical Example: Tablet Formulation Study

Factor A: Compression Force (15 kN = -1, 25 kN = +1)

Factor B: Binder Concentration (2% = -1, 6% = +1)

Factor C: Lubricant Level (0.5% = -1, 1.5% = +1)

Response: Tablet Hardness (kp)

Run Standard Order A (Compression) B (Binder) C (Lubricant) AB AC BC ABC Hardness (kp)
1 1 -1 -1 -1 +1 +1 +1 -1
2 8 +1 -1 -1 -1 -1 +1 +1
3 5 -1 +1 -1 -1 +1 -1 +1
4 3 +1 +1 -1 +1 -1 -1 -1
5 7 -1 -1 +1 +1 -1 -1 +1
6 4 +1 -1 +1 -1 +1 -1 -1
7 6 -1 +1 +1 -1 -1 +1 -1
8 2 +1 +1 +1 +1 +1 +1 +1

Randomization Note: The run order should be randomized to protect against bias. The table shows one possible random sequence.

📊 Part 2: Main Effect & Interaction Calculation

Let's Think Step-by-Step: Calculating Main Effects

Step 1: A main effect measures the average change in response when moving from low (-1) to high (+1) level

Step 2: Sum all responses where factor is at high level (+1)

Step 3: Sum all responses where factor is at low level (-1)

Step 4: Calculate the difference and divide by half the total number of runs

Main Effect Formula:
Effect_A = (Sum of Y_high - Sum of Y_low) / (n × 2^(k-1))
where n = replicates per condition, k = number of factors

🧮 Effect Calculator

Let's Think Step-by-Step: Calculating Interactions

Step 1: For AB interaction, we look at how the effect of A changes at different levels of B

Step 2: Calculate the effect of A when B is at high level

Step 3: Calculate the effect of A when B is at low level

Step 4: The AB interaction is the difference between these two A effects, divided by 2

Interaction Interpretation

Positive AB Interaction: The effect of compression force (A) is stronger when binder concentration (B) is high

Negative AB Interaction: The effect of compression force (A) is weaker when binder concentration (B) is high

No Interaction: The effect of compression force (A) is the same regardless of binder level (B)

📈 Part 3: Factorial ANOVA Analysis

Let's Think Step-by-Step: ANOVA for Factorial Designs

Step 1: We partition the total variance into different sources

Step 2: Sources include: Main effects (A, B, C), Two-factor interactions (AB, AC, BC), Three-factor interaction (ABC), and Error

Step 3: Calculate Sum of Squares (SS) for each source

Step 4: Calculate degrees of freedom (df) for each source

Step 5: Calculate Mean Squares (MS = SS/df) and F-ratios (F = MS_effect/MS_error)

🧮 ANOVA Calculator

Sum of Squares Calculation:
SS_A = (Effect_A)² × n × 2^(k-2)
SS_AB = (Effect_AB)² × n × 2^(k-2)
For 2³ design with n=1: multiply by 2

Model Equation Builder

Let's Think Step-by-Step: Building the Prediction Model

Step 1: Start with the overall mean (intercept)

Step 2: Add significant main effects (coefficient = Effect/2)

Step 3: Add significant interactions (coefficient = Effect/2)

Step 4: Final model: Y = b₀ + b₁X₁ + b₂X₂ + b₃X₃ + b₁₂X₁X₂ + ...

🎯 Part 4: Center Points & Curvature Detection

Let's Think Step-by-Step: Why Add Center Points?

Step 1: 2^k designs assume linear relationships (no curvature)

Step 2: But many pharmaceutical responses are curved (think dissolution vs time)

Step 3: Center points (0,0,0) help detect if curvature exists

Step 4: If center point response differs significantly from factorial point average, curvature is present

Pharmaceutical Example: Polymer Level and Dissolution

Imagine we're studying polymer concentration effect on dissolution rate:

  • Low level (-1): 2% polymer → 45% dissolved in 30 min
  • High level (+1): 8% polymer → 25% dissolved in 30 min
  • Center point (0): 5% polymer → 85% dissolved in 30 min

The center point shows much higher dissolution, indicating a curved relationship that 2^k design would miss!

🧮 Curvature Test Calculator

If curvature is significant, consider upgrading to Response Surface Methodology (RSM) with 3-level designs or central composite designs!

🎮 Practice Exercises

Exercise 1: Design a 2² Factorial

Scenario: You're optimizing a capsule formulation with two factors:

  • Factor A: Fill weight (495-505 mg)
  • Factor B: Disintegrant % (3-7%)

Tasks:

  1. Create the 2² design matrix with proper coding (-1, +1)
  2. Determine the actual factor levels for each coded level
  3. Add randomization to your run order

Exercise 2: Effect Calculation Practice

Given Data: Using the 2² design from Exercise 1, dissolution times (minutes) were:

  • Run 1 (-1, -1): 18.2 min
  • Run 2 (+1, -1): 12.1 min
  • Run 3 (-1, +1): 15.8 min
  • Run 4 (+1, +1): 8.9 min

Calculate:

  1. Main effect of fill weight (A)
  2. Main effect of disintegrant % (B)
  3. AB interaction effect
  4. Interpret each effect in pharmaceutical terms

Exercise 3: Model Building Challenge

Challenge: Using your calculated effects from Exercise 2:

  1. Build the prediction equation
  2. Predict dissolution time for a capsule with +0.5 coded fill weight and -0.5 coded disintegrant
  3. Convert your prediction back to actual units
  4. Assess if this represents a good formulation