Workshop Overview: From DoE Data to Decisions
Now that you've designed your experiments and collected data, it's time for the most crucial step: statistical analysis. This workshop will teach you how to extract meaningful insights from your DoE data and validate your models.
Learning Objectives: By the end of this workshop, you'll know how to perform ANOVA on DoE data, check model adequacy through residual analysis, and validate your models for reliable predictions.
Section 1: ANOVA for DoE Analysis
Model Adequacy Checking
Scenario: We conducted a 2³ factorial design to study tablet hardness. Factors: Compression Force (A), Binder Concentration (B), and Disintegrant Level (C).
Run | A: Force (kN) | B: Binder (%) | C: Disintegrant (%) | Hardness (N) |
---|---|---|---|---|
1 | -1 (15) | -1 (2) | -1 (1) | 45 |
2 | +1 (25) | -1 (2) | -1 (1) | 78 |
3 | -1 (15) | +1 (4) | -1 (1) | 52 |
4 | +1 (25) | +1 (4) | -1 (1) | 89 |
5 | -1 (15) | -1 (2) | +1 (3) | 41 |
6 | +1 (25) | -1 (2) | +1 (3) | 71 |
7 | -1 (15) | +1 (4) | +1 (3) | 47 |
8 | +1 (25) | +1 (4) | +1 (3) | 83 |
Input Y Range: C2:C9 (Hardness values)
Input X Range: D2:F9 (Coded factor levels)
Output: ANOVA table with F-statistics and p-values
Lack-of-Fit Test
Action Required: Add higher-order terms, transform variables, or consider different model forms.
Scenario: Central Composite Design for dissolution optimization with 3 center point replicates.
Condition | Replicate 1 | Replicate 2 | Replicate 3 | Mean | Pure Error |
---|---|---|---|---|---|
Center Point | 85.2% | 87.1% | 86.3% | 86.2% | 0.95 |
Corner Point | 78.5% | 79.2% | 78.9% | 78.9% | 0.33 |
Pure Error Calculation: Sum of squared deviations within each replicate group, divided by degrees of freedom.
R² and Adjusted R² Interpretation
Model | Terms | R² | Adjusted R² | Decision |
---|---|---|---|---|
Linear Only | A, B, C | 0.789 | 0.731 | Good baseline |
+ Interactions | A, B, C, AB, AC, BC | 0.892 | 0.834 | Improvement! |
+ Quadratic | All + A², B², C² | 0.903 | 0.821 | Overfitting? |
Decision Logic: Choose the model with the highest adjusted R² that includes only significant terms.
Or simply: Look at "R Square" value in Regression Analysis output
Section 2: Residual Analysis - Model Diagnostics
Normal Probability Plots
Problem: Fill weight data showing potential non-normality
Observation | Predicted | Actual | Residual | Normal Score |
---|---|---|---|---|
1 | 248.5 | 251.2 | 2.7 | -1.64 |
2 | 252.1 | 249.8 | -2.3 | -0.97 |
3 | 250.3 | 250.1 | -0.2 | -0.43 |
4 | 249.7 | 250.4 | 0.7 | 0.00 |
5 | 251.8 | 253.1 | 1.3 | 0.43 |
6 | 253.2 | 254.7 | 1.5 | 0.97 |
7 | 247.9 | 252.1 | 4.2 | 1.64 |
Analysis: Plot residuals vs. normal scores. If points deviate from straight line, consider data transformation.
Step 2: Sort residuals in ascending order
Step 3: Calculate normal scores = NORM.S.INV((RANK-0.5)/COUNT)
Step 4: Create scatter plot: X-axis = Normal Scores, Y-axis = Residuals
Residuals vs Fitted Values Plot
🎯 Interactive Residual Pattern Recognition
Click the buttons below to see different residual patterns:
Scenario: DoE study on API content uniformity showing heteroscedasticity
Solution: Consider square-root transformation of response variable.
Before Transformation: Residual variance from 0.1 to 2.4 (24-fold increase)
After √(API Content) Transformation: Residual variance from 0.05 to 0.12 (2.4-fold increase)
Cook's Distance - Influential Point Detection
where ri = standardized residual, hii = leverage, p = parameters
Run | Force (kN) | Hardness (N) | Residual | Cook's D | Status |
---|---|---|---|---|---|
1 | 15 | 45 | -2.1 | 0.08 | Normal |
2 | 20 | 58 | 1.3 | 0.03 | Normal |
3 | 25 | 71 | -0.8 | 0.01 | Normal |
4 | 30 | 45 | -25.2 | 0.89 | ⚠️ Influential |
Investigation Result: Run 4 had defective punch - legitimate removal from analysis after verification.
Leverage - High-Impact Factor Combinations
Method 2: Manual calculation using hat matrix: hii = diagonal elements
Interpretation: Sum of all leverages = number of parameters (p)
Section 3: Model Validation - Ensuring Reliability
Cross-Validation Techniques
Dataset: 16 runs from Central Composite Design
Method: 4-fold cross-validation (4 groups of 4 runs each)
Fold | Training Runs | Test Runs | R² (Training) | R² (Test) |
---|---|---|---|---|
1 | 2,3,4,...,16 | 1 | 0.94 | 0.89 |
2 | 1,3,4,...,16 | 2 | 0.93 | 0.91 |
3 | 1,2,4,...,16 | 3 | 0.95 | 0.87 |
4 | 1,2,3,...,15 | 16 | 0.94 | 0.92 |
Average Cross-Validation R²: 0.90 (vs. 0.94 on full data)
Conclusion: Model shows good predictive ability with minimal overfitting.
Confirmation Runs - The Ultimate Test
Original DoE: Optimized binder and disintegrant levels for hardness and disintegration time
Optimal Conditions Found: 3.2% binder, 2.1% disintegrant
Response | Predicted | 95% PI Lower | 95% PI Upper | Observed (n=6) | Validation |
---|---|---|---|---|---|
Hardness (N) | 75.2 | 71.8 | 78.6 | 74.1 ± 2.1 | ✅ Within PI |
Disintegration (min) | 12.5 | 10.9 | 14.1 | 13.2 ± 0.8 | ✅ Within PI |
Friability (%) | 0.65 | 0.52 | 0.78 | 0.71 ± 0.05 | ✅ Within PI |
Conclusion: All responses fall within prediction intervals - model validated!
Prediction Intervals vs Confidence Intervals
where hxx is leverage at prediction point
MSE: Mean Squared Error from ANOVA table
Leverage: Calculate for new factor combination using design matrix
Process Capability Indices
Specifications: 95.0 - 105.0% of label claim
DoE Model Residual SD: σ = 1.2% (from optimized conditions)
Target Mean: μ = 100.0%
Lower: (100.0 - 95.0) / (3 × 1.2) = 1.39
Cpk = min(1.39, 1.39) = 1.39
Expected Defect Rate: < 64 ppm (parts per million)
Workshop Summary & Key Takeaways
- ANOVA First: Check significance of effects, overall model fit (R²), and lack-of-fit
- Residual Analysis: Verify normality, constant variance, and identify outliers
- Influence Diagnostics: Use Cook's distance and leverage to find influential points
- Model Validation: Perform cross-validation and confirmation runs
- Practical Application: Calculate prediction intervals and process capability
- Using R² instead of adjusted R² for model comparison
- Ignoring residual patterns indicating model inadequacy
- Confusing confidence intervals with prediction intervals
- Removing outliers without proper investigation
- Over-interpreting models beyond the experimental region
🎯 Ready for the Capstone Project?
You now have all the statistical tools needed to analyze DoE data effectively. In the next part, you'll apply everything you've learned to a complete pharmaceutical formulation optimization project.