Professional Documents
Culture Documents
Kelle
Two factors (temperature and pressure), each with 3 levels and 5 replicates.
NOTE: For two-way ANOVA, design MUST be balanced!!!! If not, seek statistical advice.
Factors
Y Temp Pressure Cell Code Y = Grand Mean +
39 3 3
30 3 3
35 3 3
43 3 3
25 3 3
38 2 3
31 2 3
31 2 3
30 2 3
35 2 3
30 1 3
35 1 3
36 1 3
37 1 3
39 1 3
32 3 2
31 3 2
28 3 2
28 3 2
29 3 2
10 2 2
15 2 2
25 2 2
31 2 2
36 2 2
21 1 2
22 1 2
25 1 2
24 1 2
27 1 2
18 3 1
20 3 1
21 3 1
25 3 1
26 3 1
22 2 1
28 2 1
29 2 1
26 2 1
20 2 1
25 1 1
24 1 1
20 1 1
21 1 1
21 1 1
ok, 3rd Edition by T. Pyzdel and P. Keller)
Two factors (temperature and pressure), each with 3 levels and 5 replicates.
NOTE: For two-way ANOVA, design MUST be balanced!!!! If not, seek statistical advice.
Factors
Y Temp Pressure Cell Code Y = Grand Mean +
39 3 3 33 39 27.64
30 3 3 33 30 27.64
35 3 3 33 35 27.64
43 3 3 33 43 27.64
25 3 3 33 25 27.64
38 2 3 23 38 27.64
31 2 3 23 31 27.64
31 2 3 23 31 27.64
30 2 3 23 30 27.64
35 2 3 23 35 27.64
30 1 3 13 30 27.64
35 1 3 13 35 27.64
36 1 3 13 36 27.64
37 1 3 13 37 27.64
39 1 3 13 39 27.64
32 3 2 32 32 27.64
31 3 2 32 31 27.64
28 3 2 32 28 27.64
28 3 2 32 28 27.64
29 3 2 32 29 27.64
10 2 2 22 10 27.64
15 2 2 22 15 27.64
25 2 2 22 25 27.64
31 2 2 22 31 27.64
36 2 2 22 36 27.64
21 1 2 12 21 27.64
22 1 2 12 22 27.64
25 1 2 12 25 27.64
24 1 2 12 24 27.64
27 1 2 12 27 27.64
18 3 1 31 18 27.64
20 3 1 31 20 27.64
21 3 1 31 21 27.64
25 3 1 31 25 27.64
26 3 1 31 26 27.64
22 2 1 21 22 27.64
28 2 1 21 28 27.64
29 2 1 21 29 27.64
26 2 1 21 26 27.64
20 2 1 21 20 27.64
25 1 1 11 25 27.64
24 1 1 11 24 27.64
20 1 1 11 20 27.64
21 1 1 11 21 27.64
21 1 1 11 21 27.64
SST
2122.31
Press High Press Med Press Low Anova: Two-Factor With Replication
Temp High 39 32 18
30 31 20 SUMMARYPress High Press Med
35 28 21 Temp High
43 28 25 Count 5 5
25 29 26 Sum 172 148
Temp Med 38 10 22 Average 34.4 29.6
31 15 28 Variance 50.8 3.3
31 25 29
30 31 26 Temp Med
35 36 20 Count 5 5
Temp Low 30 21 25 Sum 165 117
35 22 24 Average 33 23.4
36 25 20 Variance 11.5 117.3
37 24 21
39 27 21 Temp Low
Count 5 5
Sum 177 119
Average 35.4 23.8
Variance 11.3 5.7
Total
Count 15 15
Sum 514 384
Average 34.2666667 25.6
Variance 22.0666667 44.68571429
ANOVA
Source of Variation SS df
Temp 23.5111111 2
Press 1034.84444 2
Interaction 139.555556 4
Error 924.4 36
Total 2122.31111 44
Press Low Total
5 15
110 430
22 28.66666667
11.5 46.66666667
5 15
125 407
25 27.13333333
15 59.98095238
5 15
111 407
22.2 27.13333333
4.7 43.26666667
15
346
23.06666667
10.92380952
MS F P-value F crit
11.75555556 0.457810472 0.636299836 3.2594463062
517.4222222 20.15058416 1.34241E-06 3.2594463062
34.88888889 1.358719169 0.267500581 2.6335320943
25.67777778
How to do Two-Way Anova Using Regression
This is for you information only -- You will not be asked to do 2-Way ANOVA using regression on an exam.
Remember, the purpose of this discussion was to show you why want to use the method in Tab 1 ("Data and Decomposition")
rather than try to do a 2-Way multi-level ANOVA with regression. Note: As before, the design must be balanced.
Regression Statistics
Multiple R 0.1052524
R Square 0.0110781
Adjusted R Square -0.036013 SS for the first factor
Standard Error 7.0690472 (SS Temp)
Observations 45
ANOVA
df SS MS F Significance F
Regression 2 23.511111 11.755556 0.2352455 0.7914111
Residual 42 2098.8 49.971429
Total 44 2122.3111
Coefficients
Standard Error t Stat P-value Lower 95% Upper 95%Lower 95.0%Upper 95.0%
Intercept 27.133333 1.8252201 14.865787 2.472E-18 23.44989 30.816777 23.44989 30.816777
X Variable 1 0 2.5812511 0 1 -5.2091755 5.2091755 -5.209176 5.2091755
X Variable 2 1.5333333 2.5812511 0.5940272 0.5556802 -3.6758422 6.7425088 -3.675842 6.7425088
Regression Statistics
Multiple R 0.6982855
R Square 0.4876026
Adjusted R Square 0.4632027 SS for the second factor
Standard Error 5.0884245 (SS Press)
Observations 45
ANOVA
df SS MS F Significance F
Regression 2 1034.8444 517.42222 19.983816 7.975E-07
Residual 42 1087.4667 25.892063
Total 44 2122.3111
Coefficients
Standard Error t Stat P-value Lower 95% Upper 95%Lower 95.0%
Upper 95.0%
Intercept 23.066667 1.3138255 17.556872 5.896E-21 20.415259 25.718074 20.415259 25.718074
X Variable 1 2.5333333 1.8580299 1.3634513 0.1800045 -1.2163228 6.2829894 -1.216323 6.2829894
X Variable 2 11.2 1.8580299 6.0278901 3.621E-07 7.4503439 14.949656 7.4503439 14.949656
Step 3: Regression on the dummy variables for the both factors and the interaction
SUMMARY OUTPUT SS for the for the interaction is the SS regression for this model
minus the SS Regression for each of the one-factor regressions
Regression Statistics above. That is SS Interaction = SS Regression for this model -
Multiple R 0.7512903 SS Factor 1 - SS Factor 2
R Square 0.5644371
Adjusted R Square 0.4676453
Standard Error 5.0673245 SS Interaction = 139.55556 = 1197.91-23.51-1034.84
Observations 45 df = 4
ANOVA
df SS MS F Significance F
Regression 8 1197.9111 149.73889 5.8314582 8.616E-05
Residual 36 924.4 25.677778
Total 44 2122.3111 SSE for 2-Way ANOVA
Coefficients
Standard Error t Stat P-value Lower 95% Upper 95%Lower 95.0%Upper 95.0%
Intercept 22.2 2.2661764 9.7962364 1.074E-11 17.603981 26.796019 17.603981 26.796019
X Variable 1 2.8 3.2048574 0.8736738 0.3880869 -3.6997521 9.2997521 -3.699752 9.2997521
X Variable 2 -0.2 3.2048574 -0.062405 0.9505853 -6.6997521 6.2997521 -6.699752 6.2997521
X Variable 3 1.6 3.2048574 0.4992422 0.6206462 -4.8997521 8.0997521 -4.899752 8.0997521
X Variable 4 13.2 3.2048574 4.118748 0.0002129 6.7002479 19.699752 6.7002479 19.699752
X Variable 5 -3.2 4.5323528 -0.706035 0.4847107 -12.392038 5.9920375 -12.39204 5.9920375
X Variable 6 -5.2 4.5323528 -1.147307 0.2588226 -14.392038 3.9920375 -14.39204 3.9920375
X Variable 7 6 4.5323528 1.3238157 0.1939093 -3.1920375 15.192038 -3.192038 15.192038
X Variable 8 -0.8 4.5323528 -0.176509 0.8608835 -9.9920375 8.3920375 -9.992038 8.3920375
Upper 95.0%
nd the interaction
Upper 95.0%
Two-Way ANOVA
(Must have a balanced design)
Factors
Y Temp Pressure Temp*Press Code
39 3 3 33
30 3 3 33
35 3 3 33
43 3 3 33
25 3 3 33
38 2 3 23
31 2 3 23
31 2 3 23
30 2 3 23
35 2 3 23
30 1 3 13
35 1 3 13
36 1 3 13
37 1 3 13
39 1 3 13
32 3 2 32
31 3 2 32
28 3 2 32
28 3 2 32
29 3 2 32
10 2 2 22
15 2 2 22
25 2 2 22
31 2 2 22
36 2 2 22
21 1 2 12
22 1 2 12
25 1 2 12
24 1 2 12
27 1 2 12
18 3 1 31
20 3 1 31
21 3 1 31
25 3 1 31
26 3 1 31
22 2 1 21
28 2 1 21
29 2 1 21
26 2 1 21
20 2 1 21
25 1 1 11
24 1 1 11
20 1 1 11
21 1 1 11
21 1 1 11
2-way interaction;
e me" on 2 factors
ANOVA Table
Factor SS DF
Temp 23.51 2
Main Effects
Press 1034.84 2
2-Way Interaction Temp*Press 139.56 4
SSE 924.40 36
Residuals (or Errors)
Residuals (or Errors)
SST 2122.31 44
SSTemp*Press+SSE
These will be equal to within rounding error (assuming
the design is balanced). If they are not equal (and the
design is balanced) the you have made a computation
error. Compute the Sums of Cross Products (in box
above) to help you figure out where you main the
mistake.
Degrees of Freedom (DF) for the
-Way Interaction is the product
f the degrees of freedom for the
orresponding Main Effects (i.e.,
x 2 = 4 in this case). The Mean-Squares (MS) are the
Sums-of-Squares divided by the
degrees of freedom.
Y minus Y-bar
11.36
2.36
7.36
15.36
-2.64
10.36
3.36
3.36
2.36
7.36
2.36
7.36
8.36
9.36
11.36
4.36
3.36
0.36
0.36
1.36
-17.64
-12.64
-2.64
3.36
8.36
-6.64
-5.64
-2.64
-3.64
-0.64
-9.64
-7.64
-6.64
-2.64
-1.64
-5.64
0.36
1.36
-1.64
-7.64
-2.64
-3.64
-7.64
-6.64
-6.64 Sum of the squared Y – Ybar
0.0 column. Useful for checking that the
sums of squares for the Main
SST Effects, Interactions, and Residuals
2122.31 do, in fact, add up to the SST. This is
an important check on whether or
not the calculations are correct.
This should help you figure out where you have made a computation error
by drawing you attention to the column where the error is.
DF2,true).
egrees of
DF2 is the
DF2,true).
egrees of
DF2 is the