Design and analysis of experiments (2012)

Materials
class_date       = 15, 22 March 2012 button_label     = Create my projector slides! show_page_layout = 1 show_frame_option = 1 pdf_file         = Overheads-DoE-2012-update.pdf
 * Audio: 08 March and 15 March and 22 March and 29 March
 * Video from:
 * 08 March: class 8A 8B, 8C
 * 15 March: class 9A 9B, 9C
 * 22 March: class 10A 10B, 10C
 * 29 March: class 11A
 * Course notes (print chapter 5)
 * Slides:

Software code (8 March 2012)
You can use R to find the DoE model:

You could also use MATLAB if you prefer:

3-factor example (8 March 2012)
 The data are from a plastics molding factory which must treat its waste before discharge. The :math:`y` variable represents the average amount of pollutant discharged [lb per day], while the 3 factors that were varied were:

-	:math:`C`: the chemical compound added [A or B]	-	:math:`T`: the treatment temperature [72°F or 100°F] -	:math:`S`: the stirring speed [200 rpm or 400 rpm] -	:math:`y`: the amount of pollutant discharged [lb per day]

.. tabularcolumns:: |l|l||c|c|c||c|

+---+---+---+-+-+-+	| Experiment| Order | :math:`C`    | :math:`T` [°F]  | :math:`S` [rpm] | :math:`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 :math:`C = \displaystyle \frac{(+25) + (+27) + (-1) + (-1)}{4} = \frac{50}{4} = \bf{12.5}`
 * **T effect**: There are 4 estimates of :math:`T = \displaystyle \frac{(+1) + (+3) + (+1) + (+1)}{4} = \frac{6}{4} = \bf{1.5}`
 * **S effect**: There are 4 estimates of :math:`S = \displaystyle \frac{(-27) + (-1) + (-29) + (-1)}{4} = \frac{-58}{4} = \bf{-14.5}`
 * **CT interaction**: There are 2 estimates of :math:`CT`. Recall that interactions are calculated as the half difference going from high to low.  Consider the change in :math:`C` when

-	:math:`T_\text{high}` (at :math:`S` high) = 4 - 5 = -1 -	:math:`T_\text{low}` (at :math:`S` high) = 3 - 4 = -1 -	First estimate = [(-1) - (-1)]/2 = 0 -	:math:`T_\text{high}` (at :math:`S` low) = 33 - 6 = +27 -	:math:`T_\text{low}` (at :math:`S` low) = 30 - 5 = +25 -	Second estimate = [(+27) - (+25)]/2 = +1 -	Average **CT** interaction = (0 + 1)/2 = **0.5** -	You can interchange :math:`C` and :math:`T` and still get the same result.


 * **CS interaction**: There are 2 estimates of :math:`CS`.  Consider the change in :math:`C` when

-	:math:`S_\text{high}` (at :math:`T` high) = 4 - 5 = -1 -	:math:`S_\text{low}` (at :math:`T` high) = 33 - 6 = +27 -	First estimate = [(-1) - (+27)]/2 = -14 -	:math:`S_\text{high}` (at :math:`T` low) = 3 - 4 = -1 -	:math:`S_\text{low}` (at :math:`T` low) = 30 - 5 = +25 -	Second estimate = [(-1) - (+25)]/2 = -13

-	Average **CS** interaction = (-13 - 14)/2 = **-13.5** -	You can interchange :math:`C` and :math:`S` and still get the same result.
 * **ST interaction**: There are 2 estimates of :math:`ST`: (-1 + 0)/2 = **-0.5**, calculate in the same way as above.


 * **CTS interaction**: There is only a single estimate of :math:`CTS`:

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

Next, use computer software to verify that

.. math::

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 :math:`\mathbf{X}` matrix and :math:`\mathbf{y}` vector used to calculate the least squares model:

.. math::

\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}

Example from class (15 March 2012)
 .. |-| replace:: :math:`-` .. |+| replace:: :math:`+`

Your group is developing a new product, but have been struggling to get the product's stability, measured in days, to the level required. You are aiming for a stability value of 50 days or more. Four factors have been considered:


 * **A** = monomer concentration:	30% or 50%
 * **B** = acid concentration: low or high
 * **C** = catalyst level:	2% or 3%
 * **D** = temperature: 393K or 423K

These eight experiments have been run so far:

.. tabularcolumns:: |l|l||c|c|c|c|c|

+---+---+---+-+-+-+-+ +===========+=======+===============+=================+=================+=================+=================+ +---+---+---+-+-+-+-+ +---+---+---+-+-+-+-+ +---+---+---+-+-+-+-+ +---+---+---+-+-+-+-+ +---+---+---+-+-+-+-+ +---+---+---+-+-+-+-+ +---+---+---+-+-+-+-+ +---+---+---+-+-+-+-+
 * Experiment| Order | A            | B               | C               | D               | Stability       |
 * 1        | 5     | |-|           | |-|             | |-|             | |-|             | 40              |
 * 2        | 6     | |+|           | |-|             | |-|             | |+|             | 27              |
 * 3        | 1     | |-|           | |+|             | |-|             | |+|             | 35              |
 * 4        | 4     | |+|           | |+|             | |-|             | |-|             | 21              |
 * 5        | 2     | |-|           | |-|             | |+|             | |+|             | 39              |
 * 6        | 7     | |+|           | |-|             | |+|             | |-|             | 27              |
 * 7        | 3     | |-|           | |+|             | |+|             | |-|             | 27              |
 * 8        | 8     | |+|           | |+|             | |+|             | |+|             | 20              |


 * 1) How was the experimented generated?
 * 2) What is the defining relationship?
 * 3) What will be aliased with A; with D and with BC?
 * 4) Describe the aliasing structure (resolution)?
 * 5) What is the model's intercept; main effect for A; and for the AD interaction?
 * 6) If the least squares model is:  \(y = 29.5 -5.75x_A  -3.75 x_B   -1.25 x_C + 0.75  x_D + 0.50 x_A x_B + 1.0 x_A x_C - 1.0 x_A x_D\) what is the predicted stability when operating at:
 * 7) * monomer concentration of 25%
 * 8) * low acid concentration
 * 9) * 1.5% catalyst level
 * 10) * a temperature of 408 K

General contour plots (22 March 2012)
Try running your own set of response surface optimizations for these processes:


 * 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.