This website is out of date. The new site is at http://learnche.mcmaster.ca/4C3

# Design and analysis of experiments (2011)

Video material (part 1)

Video timing

 00:00 to 03:33 Announcements 03:33 to 09:42 Overview of designed experiments 09:42 to 16:30 Experiments with one variable 16:30 to 31:56 The importance of randomization 31:56 to 42:04 Changing one variable at a single time (COST) approach 42:04 to 93:58 Factorials: 2 variables at 2 levels 93:58 to 98:12 Overview of mini-project

Video material(part 2)

Video timing

 00:00 to 28:25 3-factor factorial example 28:25 to 34:22 Announcements and overview of previous class 34:22 to 61:38 Determining significance of effects, and refitting after removing any effects 61:38 to 67:32 Comparison of COST and full factorials 67:32 to 86:16 Blocking for disturbances 86:16 to 125:26 Fractional factorial: half fractions, generators and defining relationships

Video material (part 3)

Video timing

 00:00 to 39:20 Example: analysis of a fractional factorial 39:20 to 43:00 Overview of DOE projects 43:00 to 48:20 Saturated designs for screening 48:20 to 54:15 Foldover for de-aliasing 54:15 to 59:08 Projectivity of fractional designs 59:08 to 66:20 Sequential optimization: single variable case 66:20 to 128:50 Response surface optimization in many variables 128:50 to 131:26 Evolutionary operation 131:26 to 136:45 General approach for running experiments 136:45 to 143:05 Handling constraints and optimal designs 143:05 to 146:09 Mixture designs

##  Course notes

• (PDF) Course notes
• Please print pages from Chapter 5.
• The full PDF is provided so that hyperlinks for cross-sections will work as expected.

 Class date: 7 March: covered slides 1 to 129 March: covered slides 16 to 2810 March: covered slides 29 to 4216 March: covered slides 42, 46 to 50, 63 to 6617 March: guest speaker21 March: covered slides 67 to 7623 March: covered 77 to 88, and 103-10724 March: covered 108 to 119 I want my notes with: 1x1 (landscape) 2x1 (portrait) 3x1 (portrait) 3x1 (but with space for notes) 2x2 (landscape) 3x2 (portrait) pages per physical page Use page frames?

 Class date: 17 March I want my notes with: 1x1 (landscape) 2x1 (portrait) 3x1 (portrait) 3x1 (but with space for notes) 2x2 (landscape) 3x2 (portrait) pages per physical page Use page frames?

##  Audio recordings of 2011 classes

Date Material covered Audio file
07 March 2011 Single variable experiments, randomization, changing one single variable at a time (COST) approach Class 22
09 March 2011 Analysis of a 2 factor experiment: without interactions, and with interactions Class 23
10 March 2011 Factorial analysis using least squares; 3-factor experiment example (contains an integer variable) Class 24
16 March 2011 Assess if factors are significant or not; blocking and confounding Not available
17 March 2011 Guest speaker, Emily Nichols, on DOEs Class 26
21 March 2011 Fractional factorials; generators and defining relationships Class 27
23 March 2011 Saturated designs; response surface methods Class 28
24 March 2011 Response surface methods Class 29
28 March 2011 Dealing with incorrect experiments and constraints; wrapping up DOEs; take-home review. Class 30

Thanks to the various students responsible for recording and making these files available

##  3-factor example

The data are from a plastics molding factory which must treat its waste before discharge. The $$y$$ variable represents the average amount of pollutant discharged [lb per day], while the 3 factors that were varied were:

• $$C$$: the chemical compound added [A or B]
• $$T$$: the treatment temperature [72°F or 100°F]
• $$S$$: the stirring speed [200 rpm or 400 rpm]
• $$y$$: the amount of pollutant discharged [lb per day]
Experiment Order $$C$$ $$T$$ [°F] $$S$$ [rpm] $$y$$ [lb]
1 5 A 72 200 5
2 6 B 72 200 30
3 1 A 100 200 6
4 4 B 100 200 33
5 2 A 72 400 4
6 7 B 72 400 3
7 3 A 100 400 5
8 8 B 100 400 4

We showed the cube plot for this system in the class on 10 March. From the cube plot we could already see the main factors, and even the CS interaction was noticeable.

• C effect: There are 4 estimates of $$C = \displaystyle \frac{(+25) + (+27) + (-1) + (-1)}{4} = \frac{50}{4} = \bf{12.5}$$

• T effect: There are 4 estimates of $$T = \displaystyle \frac{(+1) + (+3) + (+1) + (+1)}{4} = \frac{6}{4} = \bf{1.5}$$

• S effect: There are 4 estimates of $$S = \displaystyle \frac{(-27) + (-1) + (-29) + (-1)}{4} = \frac{58}{4} = \bf{-14.5}$$

• CT interaction: There are 2 estimates of $$CT$$. Recall that interactions are calculated as the half difference going from high to low. Consider the change in $$C$$ when

• $$T_\text{high}$$ (at $$S$$ high) = 4 - 5 = -1
• $$T_\text{low}$$ (at $$S$$ high) = 3 - 4 = -1
• First estimate = [(-1) - (-1)]/2 = 0
• $$T_\text{high}$$ (at $$S$$ low) = 33 - 6 = +27
• $$T_\text{low}$$ (at $$S$$ low) = 30 - 5 = +25
• Second estimate = [(+27) - (+25)]/2 = +1
• Average CT interaction = (0 + 1)/2 = 0.5
• You can interchange $$C$$ and $$T$$ and still get the same result.
• CS interaction: There are 2 estimates of $$CS$$. Consider the change in $$C$$ when

• $$S_\text{high}$$ (at $$T$$ high) = 4 - 5 = -1
• $$S_\text{low}$$ (at $$T$$ high) = 33 - 6 = +27
• First estimate = [(-1) - (+27)]/2 = -14
• $$S_\text{high}$$ (at $$T$$ low) = 3 - 4 = -1
• $$S_\text{low}$$ (at $$T$$ low) = 30 - 5 = +25
• Second estimate = [(-1) - (+25)]/2 = -13
• Average CS interaction = (-13 - 14)/2 = -13.5
• You can interchange $$C$$ and $$S$$ and still get the same result.
• ST interaction: There are 2 estimates of $$ST$$: (-1 + 0)/2 = -0.5, calculate in the same way as above.

• CTS interaction: There is only a single estimate of $$CTS$$:

• $$CT$$ effect at high $$S$$ = 0
• $$CT$$ effect at low $$S$$ = +1
• $$CTS$$ interaction = [(0) - (+1)] / 2 = -0.5
• You can calculate this also by considering the $$CS$$ effect at the two levels of $$T$$
• Or, you can calculate this by considering the $$ST$$ effect at the two levels of $$C$$.
• All 3 approaches give the same result.

Next, use computer software to verify that

$y = 11.25 + 6.25x_C + 0.75x_T -7.25x_S + 0.25 x_C x_T -6.75 x_C x_S -0.25 x_T x_S - 0.25 x_C x_T x_S$

The $$\mathbf{X}$$ matrix and $$\mathbf{y}$$ vector used to calculate the least squares model:

$\begin{split}\begin{bmatrix} 5\\30\\6\\33\\4\\3\\5\\4 \end{bmatrix} &=\begin{bmatrix} +1 & -1 & -1 & -1 & +1 & +1 & +1 & -1\\ +1 & +1 & -1 & -1 & -1 & -1 & +1 & +1\\ +1 & -1 & +1 & -1 & -1 & +1 & -1 & +1\\ +1 & +1 & +1 & -1 & +1 & -1 & -1 & -1\\ +1 & -1 & -1 & +1 & +1 & -1 & -1 & +1\\ +1 & +1 & -1 & +1 & -1 & +1 & -1 & -1\\ +1 & -1 & +1 & +1 & -1 & -1 & +1 & -1\\ +1 & +1 & +1 & +1 & +1 & +1 & +1 & +1\\\end{bmatrix}\begin{bmatrix} b_0 \\ b_C \\ b_T \\ b_{S} \\ b_{CT} \\ b_{CS} \\ b_{TS} \\ b_{CTS} \end{bmatrix} \\\mathbf{y} &= \mathbf{X} \mathbf{b}\end{split}$

##  Visualizing a response surface

You can easily create your own response surfaces and visualize them. Then practice on them before and during the take-home exam. Here are equations for the 4 examples given in class on Thursday:

• A simple optimum: $$y = 83 +9.4x_A +7.1x_B -6 x_A x_B - 7.4 x_A^2 -3.7 x_B^2$$
• A stationary ridge: $$y = 83 + 10.0x_A + 5.6x_B - 7.6 x_A x_B - 6.9 x_A^2 - 2.0 x_B^2$$
• A rising ridge: $$y = 83 + 8.8x_A + 8.2x_B - 7.6 x_A x_B - 7.0 x_A^2 - 2.4 x_B^2$$
• A saddle point: $$y = 83 + 11.1x_A + 4.1x_B - 9.4 x_A x_B - 6.5 x_A^2 - 0.4 x_B^2$$

Binary variables should be treated exactly like continuous variables in all respects during the optimization. The only difference is that it makes sense to visualize and use them at the two levels.

###  Plotting code

MATLAB code used in class on 23 March 2011 to do the first factorial:

X = [+1 +1 +1 +1; ...
-1 +1 -1 +1; ...
-1 -1 +1 +1; ...
+1 -1 -1 +1]';

% Profit values recorded from the factorial experiments
profit = [193 310 468 571]';
% Coefficient order = [Intercept, b_T, b_S, b_{TS}]
b = inv(X'*X)*X'*profit

% What does the model surface look like?
[T, S] = meshgrid(-2:0.1:2, -2:0.1:2);
Y = b(1) + b(2).*T + b(3).*S + b(4).*T.*S;

subplot(1, 2, 1)
surf(T, S, Y)
xlabel('T')
ylabel('S')
grid('on')

subplot(1, 2, 2)
contour(T, S, Y)
xlabel('T')
ylabel('S')
grid('on')
axis equal
colorbar

MATLAB code used in class on 24 March 2011 to continue with the central composite design factorial:

% CCD design around point 6
% Put 4 factorial points first, then the center point
% then the 4 axial (star) points
a = sqrt(2);
X = [1 -1 -1; ...
1 +1 -1; ...
1 -1 +1; ...
1 +1 +1; ...
1  0  0; ...
1  0 -a; ...
1 +a  0; ...
1  0  a; ...
1 -a  0];
X(:,4) = X(:,2) .* X(:,3);  % TS = T x S
X(:,5) = X(:,2) .* X(:,2);  % TT = T x T
X(:,6) = X(:,3) .* X(:,3);  % SS = S x S
y = [694 725 620 642  688  720 700 610 663]';
b = inv(X'*X)*X'*y
[T,S] = meshgrid(-2:0.1:3, -3:0.1:2);
Y = b(1) + b(2).*T + b(3).*S + b(4).*T.*S + b(5).*T.*T + b(6).*S.*S;

subplot(1, 2, 1)
surf(T, S, Y)
xlabel('T')
ylabel('S')
grid('on')

subplot(1, 2, 2)
contour(T, S, Y)
xlabel('T')
ylabel('S')
grid('on')
axis equal
colorbar

% Predicted optimum: $737, actual value at this point:$737.8
T = +2.25;
S = -1.75;
y_hat_opt = b(1) + b(2).*T + b(3).*S + b(4).*T.*S + b(5).*T.*T + b(6).*S.*S