Mathematics and Statistics –
Design and Analysis of Experiments
Week 8 – Factorial Designs (cont. from week 7)
Copyright By PowCoder代写 加微信 powcoder
Hands-on Activity
1. Conduct a Tukey’s Multiple Comparison procedure to
0. compare three types at Temperature = 70
2. Conduct a Linear and Quadratic Trend analysis of responses in relation to Temperature for the Material Type 2.
(Hint: Orthogonal Polynomial Coefficients for three levels: are Linear: -1, 0, 1 Quadratic: 1, -2, 1
3. Conduct a Tukey’s pairwise comparison for the Material Type.
4. If one is interested in quantifying the uncertainty of individual observation, yijk, what is s.d. of yijk?
5. If one is interested in quantifying the uncertainty of Mean response of each material type, what is it?
An interesting question for the Battery Life Time study is: Is the trend of Life time in relation to Temperature for Material Type 1 different from that for Material Type 2?
The question is: Do these three linear lines have the similar slopes. That is,
If the rates of change of life time from Low temperature to High Temperature are similar or not.
The slower rate change means the life time is less sensitive to the temperature.
Interaction Plot between Material Type and Temperature
ANOVA Table with Sum of Squares Decomposition
Analysis of Variance Source DF
for Life, using Adjusted SS for Tests
Matype C1 C2
Linear 1 SSL
Quadratic 1 SSQ
Seq SS 10633.2
Adj SS Adj MS F P 10633.2 5316.6 7.98 0.002
2 39083.2 39083.2 19541.6 29.34 0.000
Matype*Temp 4 9437.7 9437.7 2359.4 3.54 0.019
C1*Linear 1 C2*Linear 1 C1*Quadratic 1 C2*Quadratic 1
Error 27
Total 35
SS(C1*L) SS(C2*Q) SS(C1*Q) SS(C2*Q)
17980.7 666.0
This Sum of Squares partitioning technique is very useful , especially when we are interested in a specific part of the effects. The method is based on Contrasts.
SSA = SSC1+SSC2 and DF(A) = DF(C1) + DF(C2) SSB = SSL + SSQ and DF(B) = DF(L) + DF (Q) SSAB = SS(C1*L) + SS(C2*L) + SS(C1*Q) + SS(C2*Q)
The question :
Do the three linear response lines in relation to Temperature have the similar slopes?
Can be answered using the sum of square decomposition technique. This is simply to test if the combined two contrasts of of (C1*Linear) and(C2*Linear) is significant or not.
How do I know that?
Since C1*Linear + C2*Linear = Type*Linear(Temp). This information indeed reflects the linear pattern of temperature at different Material Types.
From the ANOVA point of view, we are trying to test part of the interaction effect.
When we observe the data information, the question we ask here is the same as the following:
Linear Trend of Temperature
At Material Type 1
L =y −y =134.75−57.5=77.25
At Material Type 2
L =y −y =155.75−49.5=96.25
At Material Type 3
L =y −y =144.00−85=59.0
Are L1, L2 and L3 significantly different?
One can apply pairwise comparison technique such as Tukey’s method to make three comparisons. We have learned how to do this.
Or one can use the Sum of Squares partition technique to test if Material Type*Linear(Temp) is significant or not. We will discuss this techniques
by hand and by software.
We will use the contrast techniques to solve this problem by hand, and show how to do this using software
Determine the Sum of Square for Linear(Temp)*Material Type
Material Type has three levels. This means we can partition the Material Type into two orthogonal contrasts. Two meaningful orthogonal contrasts for comparing Material Type could be:
(1) C1: A contrast for comparing Type 1 with Type 3.
(2) C2: A contrast for comparing Average of Type 1 and Type 3) with Type 2.
How to set up contrasts for these two comparisons? How do I know these two comparisons are orthogonal?
Material Type
C1: Type 1 Vs Type 3
C2: (Type1+type3)/2 Vs Type 2
The multiple, br, is the number of observations
used to compute
SSC=br( ky)
Sum of Squares for each contrast is k2 i
NOTE: One can partition the two df of Material Type using different set of orthogonal contrasts as wish.
Similarly, the trend of temperature is a contrast:
Temperature
SSC = ar ( k y )
The multiple, ar, is the number of observations
used to compute
Sum of Squares for each contrast is
How about the interaction between C1(Type)*Linear(Temp) and C2(Type)*Linear(Temp)
If we can obtain the Sum of Squares for each of the Interaction term, Adding these two together, it is the Sum of Squares for the
(Material Type)*Linear(Temp)
Determine Sum of Square of C1*Linear and C2*Linear for the Life Time Study
It is important to understand that an interaction term such as C1*Linear is still a CONTRAST. If we know how to set a proper contrast for C1*Linear, we can determine the corresponding SS.
How to set up a proper contrast for C1*Linear?
X (multiplication)
C1 of Material Type
Linear Contrast of Temperature
As we know a contrast is just a weighted sum of the mean responses.
For Material Type, the mean responses are : m1. , m2. , m3. For Temperature, the mean responses are : m.1 , m.2 , m.3 For Interaction, the mean responses are: the 9 mij ‘ s.
The coefficients for settin up C1*Linear contrast is the multiplications of the coefficients of C1 and Linear. They are given in the aboce table.
The contrast for C1*Linear is
Mean Responses
kij , coefficients
The corresponding estimate from sample iks y
The corresponding Sum of Squares is 2
SS(C1*L) = (r) i j k2
kij yij.
SE(C1*L) = k2
The multiple (r) is the number of observations used to compute yij. The Standard Error of (C1*L) can also be estimated by:
Determine SS(C1*L) for the Battery Life Case
Matype*Temp ( yij.)
The estimate of the contrast C1*Linear is
1 15 1 70 1 125 2 15 2 70 2 125 3 15 3 70 3 125
134.75 12.903
57.25 12.903
57.50 12.903
155.75 12.903 117.25 12.903 49.50 12.903 144.00 12.903 145.75 12.903 85.50 12.903
(134.75 – 57.5 – 144.0 + 85.5) = 18.75
SS(C1*L) = (r) i j k2
kij yij.
(18.75)2 = 351.56 (1+1+1+1)
The SE(C1*L) is
MSE 666
SE(C1*L) = k2 = (1+1+1+1) = 25.806
r ij 4 ij
Hands-On Activity
1. Set up the contrast for C2*Linear.
2. Estimate the C2*Linear contrast, compute the corresponding Sum of Squares, and SE of the estimate.
3. Add the SS of C1*L and C2*L together and conduct an F- test to test if the Material Type*Linear(Temp) significant or not, and make an appropriate conclude of this F-test.
Use software to conduct a general linear model analysis
You must specify the model terms in the Model box. This is an abbreviated form of the statistical model that you may see in textbooks. Because you enter the response variable(s) in Responses, in Model you enter only the variables or products of variables that correspond to terms in the statistical model. Software uses a simplified version of a statistical model as it appears in many textbooks. Here are some examples of statistical models and the terms to enter in Model. A, B, and C represent factors.
Case Statistical model Terms in model
Factors A, B crossed yijk = m + ai + bj + abij + ek(ij) A B A*B
Factors A, B, C crossed yijkl = m + ai + bj + ck + abij + acik + bcjk + abcijk + el(ijk) A B C A*B A*C B*C
A*B*C 3 factors nested
(B within A, C within A and B)
yijkl = m + ai + bj(i) + ck(ij) + el(ijk)
Crossed and nested (B nested within A, both crossed with C)
yijkl = m + ai + bj(i) + ck + acik + bcjk(i) + el(ijk)
A B(A) C(AB)
A B(A) C A*C B*C
Rules for Expression Models
1. * indicates an interaction term. For example, A*B is the interaction of the factors A and B.
2. ( ) indicate nesting. When B is nested within A, type B(A). When C is nested within both A and B, type C(A B). Terms in parentheses are always factors in the model and are listed with blanks between them.
3. Abbreviate a model using a | or ! to indicate crossed factors and a – to remove terms.
4. Terms in parentheses are always factors in the model and are listed with blanks between them. Thus, D*F (A B E) is correct but D*F (A*B E) and D (A*B*C) are not.
5. Also, one set of parentheses cannot be used inside another set. Thus, C (A B) is correct but C (A B (A)) is not.
6. An interaction term between a nested factor and the factor it is nested within is invalid.
Examples of what to type in the Model text box
Two factors crossed:
Three factors crossed:
Three factors nested:
Crossed and nested (B nested within A, and both crossed with C): A B(A) C A*C B*C(A)
When a term contains both crossing and nesting, put the * (or crossed factor) first, as in C*B(A), not B(A)*C
A B A*B (or enter A|B for a full factorial model.)
A B C A*B A*C B*C A*B*C (or enter A|B|C for a full factorial model). A B(A) C(A B)
Use software to conduct Sum of Squares partitions – the Battery Life Case
The following is the Minitab command that is used to produce the result.
This is created by using the Pull-down Menu and enabling the commands.
GO TO Editor and choose ‘enable Commands’ will provide you the actual Minitab program in the output.
MTB > GLM ‘Life’ = Matype Temp Temp*temp Matype*temp Matype*temp*temp;
SUBC> Covariates ‘Temp’;
SUBC> Brief 1 .
This model enables us to conduct the sum of square partitions as we discussed here. Steps for running Minitab procedure: Generalized Linear Model:
1. Go to Stat, choose ANOVA, then select ‘General Linear Model’.
2. In the dialog box, enter Response variable. In the Model box, enter
Matype Temp Temp*temp Matype*temp Matype*temp*temp Choose ‘Covariate’ and enter ‘Temp’ as covariate.
3. For other selections, please consult the One-Way analysis.
The ANOVA results produced by Minitab using the model statement:
MTB > GLM ‘Life’ = Matype Temp Temp*temp
Matype*temp Matype*temp*temp;
SUBC> Covariates ‘Temp’; SUBC> Brief 1 .
General Linear Model: Life versus Matype
Factor Type Levels Values
Matype fixed 3 1 2 3
Analysis of Variance for Life, using
Adjusted SS for Tests
Adj MS F
589.3 0.88
1406.3 2.11
40.5 0.06
3533.4 5.31
3561.3 5.35
Matype*Temp
Matype*Temp*Temp
27 17980.8 17980.8 666.0
35 77134.8
Temp : Linear, Temp*Temp: Quadratic, Matype*Temp : Type*Linear(Temp), Matype*Temp*Temp: Type*Quadratic(Temp)
Hands-on Project
The yield of a chemical process is suspected to be affected by the pressure and temperature of the process. Each factor has three choices in the chemical process. Pressure: 200, 215 and 230. Temperature: Low, medium and high. A factorial experiment with two replications is performed. The yield data are collected:
Row Pressure Temp Yield
1 200 Low 90.4
2 200 Low 90.2
3 200 Medium 90.1
4 200 Medium 90.5
5 200 High 90.3
6 200 High 90.8
7 215 Low 89.8
8 215 Low 89.6
9 215 Medium 90.1
Row Pressure Temp Yield
10 215 Medium 90.2
11 215 High 90.8
12 215 High 90.7
13 230 Low 90.6
14 230 Low 90.8
15 230 Medium 90.2
16 230 Medium 90.5
17 230 High 90.3
18 230 High 90.0
Conduct a proper analysis and make some recommendations based
on the findings.
Row Depth Feed Rough 1 0.12 0.20 74 2 0.12 0.20 68 3 0.12 0.20 60 4 0.12 0.25 90 5 0.12 0.25 85 6 0.12 0.25 89 7 0.12 0.30 99 8 0.12 0.30 106 9 0.12 0.30 103
10 0.14 0.20 79 11 0.14 0.20 67 12 0.14 0.20 75
Row Depth Feed Rough 13 0.14 0.25 99 14 0.14 0.25 102 15 0.14 0.25 94 16 0.14 0.30 107 17 0.14 0.30 106 18 0.14 0.30 98 19 0.16 0.20 80 20 0.16 0.20 84 21 0.16 0.20 86 22 0.16 0.25 91 23 0.16 0.25 95 24 0.16 0.25 98
Row Depth Feed Rough
25 0.16 0.30 99
26 0.16 0.30 105
27 0.16 0.30 100
28 0.18 0.20 99
29 0.18 0.20 102
30 0.18 0.20 103
31 0.18 0.25 108
32 0.18 0.25 111
33 0.18 0.25 99
34 0.18 0.30 111
35 0.18 0.30 110
36 0.18 0.30 106
Two-Factor Design – Random effect model
Through cause-effect diagram and team discussion, it was suspected that the surface finish of a metal part is influenced by the feed rate and the depth of cut. The variability is of a particular concern, since uneven metal finish will result leaking of the finish products using this metal. Three feed rates and four depths of cuts are randomly chosen. A factorial experiment with three replications is performed. The surface roughness is measured and recorded. The lower the roughness, the better the surface.
Statistical Model for tow random effect Factor Experiment
The levels of two factors are randomly chosen, and the variability among levels are the main concern. This is clearly a random effect model. The variance components are the main interest. An appropriate model is:
The observation , yijk can be expressed as:
yijk = m + i + j + ( )ij + eijk , i=1,2,…,a; j = 1,2,…, b; k = 1,2,…,r.
where m is the unknow grand mean,
i ~ N(0, ), which are the ranom effects of Factor A.
j ~ N (0, ), which are the random effects of Factor B
ij ~ N(0, ), which are the random effects of A and B interaction
eijk ~ N (0, ), which is the random error due to replications.
And these components are independent.
Note we have four variance components: 2 , 2 , 2 , 2 .
The observation y ~ N(m,2 +2 +2 +2 ijk
The main goal is to estimate the four variance components to understand the source of uncertainty.
Based on the model, the ANOVA and the corresponding EMS, which will be used to estimate the variance components , are given by:
Treatment A
MSA=SSA/(a-1)
2 +r2 +br2
Treatment B
MSB=SSB/(b-1)
2 +r2 +ar2
AB Interaction
(a-1)(b-1)
MSAB=SSAB/ [(a-1)(b-1)]
2 +r2
MSE=SSE/[ab(r-1)]
The F-statistics test the following hypotheses:
F = MSA tests: H : 2 = 0 Vs. H : 2 > 0 AMSE0 a
F = MSB tests: H : 2 = 0 Vs. H : 2 > 0 BMSE0 a
F = MSAB tests: H : 2 = 0 Vs. H : 2 > 0 ABMSE0 a
Based on the EMS, the variance components are estimated by:
ˆ2 =MSA−MSAB
ˆ2 =MSB−MSAB
ˆ2 =MSAB−MSE
ˆ2 =ˆ2 +ˆ2 +ˆ2 +ˆ2 y
100(1- )% confidence interval for 2 is
Lower Bound =
( / 2,ab(r−1))
Upper Bound =
(1− / 2,ab(r−1))
In many applications, the variance components are presented in terms of percent of variance component, or the s.d. components , which as known as measurement uncertainties are presented, instead of variance.
General Linear Model: Rough versus Depth, Feed
Analysis of Variance for Rough, using Adjusted SS for Tests
Type Levels Values
random 4 0.12 0.14 0.16 0.18 random 3 0.20 0.25 0.30
Depth*Feed 6 783.28 783.28 130.55 6.84 0.000 Error 24 458.00 458.00 19.08
DF Seq SS Adj SS Adj MS F P 3 1801.56 1801.56 600.52 4.60 0.053 2 3230.72 3230.72 1615.36 12.37 0.007
Total 35 6273.56
Unusual Observations for Rough
Obs Rough Fit SE Fit Residual St Resid
3 60.000 67.333 2.522 -7.333 -2.06R
The ANOVA results indicate all three uncertainty components are statistically significant when compared to the random error. Different Feeding Rates, different Depth all introduces huge variation. In particular, the significance of Depth*Feed interaction component indicates there is a huge inconsistence of roughness due to different feeding rates for different level of depths.
The analysis of the Surface Roughness data
Expected Mean Squares, using Adjusted SS
3 Depth*Feed (4) + 3.0000(3) 4 Error (4)
Expected Mean Square for Each Term (4) + 3.0000(3) + 9.0000(1)
(4) + 3.0000(3) + 12.0000(2)
This EMS provides information for making proper F-tests.
Error Terms for Tests, using Adjusted SS
3 Depth*Feed
Error DF Error MS Synthesis of Error MS
More than 50% of the variability is due to feeding Rate. A further analysis would needed to determine the causes of the uncertainty due to Feed Rate. The Depth contributes 22.5% of the variability. The Interaction is about 16%.
These components are all
130.55 (3) 130.55 (3) 19.08 (4) Variance Components, using Adjusted SS
roughness is
6.00 24.00
Source Estimated Value Depth 52.22 Feed 123.73 Depth*Feed 37.15 Error 19.08
% Variance 22.5%
The overall uncertainty of a measurement of
statistically significant.
ˆ y = 52.22 + 123.73 + 37.15 + 19.08 = 232.18 = 15.24
Test for Equal Variances
Bonferroni 95% CI for s.d. of Residuals
Lower Sigma Upper N Factor Levels
2.82680 7.02377 153.803 3 0.12 0.20 1.06481 2.64575 57.935 3 0.12 0.25 1.41340 3.51188 76.901 3 0.12 0.30 2.45908 6.11010 133.796 3 0.14 0.20 1.62653 4.04145 88.498 3 0.14 0.25 1.98529 4.93288 108.018 3 0.14 0.30 1.22954 3.05505 66.898 3 0.16 0.20 1.41340 3.51188 76.901 3 0.16 0.25 1.29373 3.21455 70.391 3 0.16 0.30 0.83779 2.08167 45.583 3 0.18 0.20 2.51337 6.24500 136.750 3 0.18 0.25 1.06481 2.64575 57.935 3 0.18 0.30
Test for Equal Variances for Residuals
Residuals Versus the Fitted Values (response is Rough)
95% Confidence Intervals for Sigmas
Factor Levels
0.12 0.20 0.12 0.25 0.12 0.30 0.14 0.20 0.14 0.25 0.14 0.30 0.16 0.20 0.16 0.25 0.16 0.30 0.18 0.20 0.18 0.25 0.18 0.30
0 50 100 150
70 80 90 100 110 Fitted Value
Normal Probability Plot
Bartlett’s Test
5 Test Statistic: 5.535 P-Value : 0.903
Test Statistic: 0.372 -5 P-Value : 0.955
Levene’s Test
Both Normality and Constant Variance seem to be fine. No transformation will be
.999 .99 .95
.80 .50 .20
Average: -0.0000000 StDev: 3.61742
-5 0 5 RESI1
Anderson- Test A-Squared: 0.658
P-Value: 0.079
Probability
Hands-on Project of Random Effect Model: Two Factor Experiment (Data Source: Kuehl 2000)
Spectrophotometer is used in medical clinical laboratories. The consistency of measurements from day to day among machines is very critical. An uncertainty study is conducted to evaluate the variability of measurements among machines operate over several days, and to study if the machine uncertainty is within an acceptable standards for applications.
Treatment Design: A factorial design is planned with treatments are Four randomly chosen machines, which will be tested on four randomly selected days.
Experimental Design: For each day, eight replicate serum samples will be tested. Two are randomly assigned to each machine for testing. The same well-trained technician prepares the serum samples and operates the machine throughout the experiment. The measurement is the Triglyseride levels(mg/dl) in serum samples.
Conduct an appropriate analysis and make suggestions for improvement
Row Day Machine Trig 11 1142.3 21 1144.0 31 2148.6 41 2146.9 51 3142.9 61 3147.4 71 4133.8 81 4133.2 92 1134.9
102 1146.3 112 2145.2 122 2146.3 132 3125.9 142 3127.6 152 4108.9 162 4107.5
Row Day Machine Trig 173 1148.6 183 1156.5 193 2148.6 203 2153.1 213 3135.5 223 3138.9 233 4132.1 243 4149.7 254 1152.0 264 1151.4 274 2149.7 284 2152.0 294 3142.9 304 3142.3 314 4141.7 324 4141.2
Mixed-Models with Nested and Crossed Factors Designs
An extension from two factors to three or more are straightforward if the factors are all fixed or all random. However, in many laboratory testing studies, the factors may be mixed, that is some are fixed and some are random. This occurs often when both nested and crossed factors are in the experiment. The following case study demonstrate the analysis of such an experiment.
Factor A is nested in B mea
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com