Beruflich Dokumente
Kultur Dokumente
Introduction to Factorial
Designs
and their Analysis
1
X111
X11n
X211
X21n
:
Xa11
Xa1n
Factor B
2
...
X121
...
X12n
...
X221
...
X22n
...
:
:
Xa21 ...
Xa2n ...
There are
b
X1b1
X1bn
X2b1
X2bn
:
Xab1
Xabn
a X b treatment
Observation k
in each cell
Xijk
Level i
Factor
A
Level j
Factor
B
i = 1,,a
j = 1,
,b
Motivating Example:
Capsule Dissolve Time
Suppose are looking at two capsule types
(C or V) & two digestive fluids (Gastric
or Duodenal)
Randomly assign 5
capsules of each
type to each of
type of digestive
juice and observe
dissolve time.
Xijk = measured
dissolve time for
capsule k in
digestive juice i
and capsule type j.
i = 1 or 2 (i.e. G
and D)
j = 1 or 2 (i.e. C
Questions of Interest
What effect does capsule type
have on the time to dissolve?
What effect does fluid type
have on the time to dissolve?
Do both capsule types dissolve
in the same manner in the
two different fluid types?
Capsule
Type
Fluid Type
Preliminary Conclusion
There is very little difference between the
capsule types in terms of the length it time it
takes them to dissolve.
Capsules take about 5 seconds longer on
average to dissolve in gastric juice than in
duodenal juice.
THESE CONCLUSIONS ARE
COMPLETELY WRONG!!
WHY ?!?
Interactions
The capsule study is an example
of
Type C capsules
dissolve
faster than
situation where there is an
interaction
V studied
in duodenal
between the two factors Type
being
in
juice, where
terms of their effect on the
numeric
opposite
is true
response.
when gastric juice
is used to dissolve
the capsules.
The apparent
lack of a capsule
effect is caused
by the
interaction of
capsule type
and fluid type.
depending on the
level of B. Neither
the A or B main
effects are masked by
the interaction.
Types of Interactions
In summary there are types of
interactions:
Differences in Direction
Differences
in Magnitude
Questions of Interest
Generally, the questions of interest here
(i.e. hypotheses to be tested) concern
three questions regarding the potential
effects of the factors on the response
variable.
Question 1: Do the effects that factors A
and B have on the response variable
interact, i.e. is there a significant
interaction between factors A and B ?
Questions of Interest
If we conclude there is a significant
interaction then we conclude the
effects of both factors
A and B are significant!
When we have an interaction we cannot
consider the effect of either factor
independently of the other, therefore
both factors matter.
Questions of Interest
If there is not a significant
interaction effect then we can
consider the main effects
separately, i.e. we ask the
following:
Question 2: Does factor A alone have
a significant effect?
Question 3: Does factor B alone have
a significant effect?
Tests of Hypotheses
Just as we had Sums of Squares and
Mean Squares in One-way ANOVA, we
have the same in Two-way ANOVA:
Recall, Mean Squares are measures of
variability across the levels of the relevant
factor of interest.
In balanced Two-way ANOVA, we measure
the overall variability in the data by:
a
SS T ( X ijk X ) 2
i 1 j 1 k 1
df N 1
Tests of Hypotheses
Sum of Squares for factor A
a
SS A ( X i X ) bn ( X i X ) 2
2
i 1 j 1 k 1
df a 1
i 1
SS B ( X j X ) an ( X j X ) 2 df b 1
i 1 j 1 k 1
j 1
Test of Hypotheses
Interaction Sum of Squares
a
SS AB ( X ij X i X j X ) 2
df (a 1)(b 1)
i 1 j 1 k 1
SS E ( X ijk X ij ) 2
df ab(n 1)
i 1 j 1 k 1
Tests of Hypotheses
So the Two-way ANOVA Identity is:
SS T SS A SS B SS AB SS E
This partitions the Total Sum of
Squares into four pieces of
interest for our hypotheses to be
tested.
Tests of Hypotheses
As in One-way ANOVA, we obtain mean
squares for the different effects by dividing
the sums of squares by their respective
degrees of freedom
SS effect
i.e. MS effect
df effect
These are our measures of variance for the
analysis.
If an effect is not
we expect
MSsignificant
effect MS E
and if it is we expect
MS effect MS E
Test of Hypotheses
F-Statistic for Testing an Effect
Fo
MS effect
MS E
~ F distribution
Numerator df =
dfeffect
Denominator df =
If the F-statistic is large we reject that the df
effect
is zero in
error
favor of the alternative that the effect of the factor is non-zero.
Sum of
Squares
Mean
Square F-ratio
P-value
Factor A
a1
SSA
MSA
FA = MSA / MSE
Tail area
Factor B
b1
SSB
MSB
FB = MSB / MSE
Tail area
Interaction
(a 1)(b 1)
SSAB
MSAB
Tail area
Error
ab(n 1)
SSE
MSE
Total
abn 1
SST
Tests of Hypotheses
If the interaction is not statistically significant
(i.e. p-value > 0.05) then we conclude the
main effects (if present) are independent of
one another.
We can then test for significance of the main
effects separately, again using an F-test.
If a main effect is significant we can then use
multiple comparison procedures as usual to
compare the mean response for different
levels of the factor while holding the other
factor fixed.
Tests of Hypotheses
If an interaction is significant (p-value < .05) we
conclude the main effects are not independent of
one another and that both effects are important!
In this case (i.e. the interaction is significant) the tests
for main effects in the Two-way ANOVA table are
MEANINGLESS!
Example 1: Capsule
Dissolve Time
Enter the n = 5
replicates for each
treatment combination:
Gastric, C
Gastric, V
Duodenal, C
Duodenal, V
Example 1: Capsule
Dissolve Time
1st Highlight
both factors
in this list.
Next
highlight Full
Factorial from
the Macros
pull-down
menu.
Example 1: Capsule
Dissolve Time
Example 1: Capsule
Dissolve Time
Checking Assumptions
To check the assumptions of normality
of the response and equality of
variance for the difference treatment
combinations we can examine the
residuals. For a two-way ANOVA
the residuals are the deviations of
the observations from their
respective etreatment
combination
x
ijk
ijk
ij
sample means, i.e.
Checking Assumptions
To check the assumption of normality,
xijkresiduals
xij
assess the normalityeof
the
ijk
The residuals
from the capsule
experiment look
approximately
normal with the
exception of two
outliers, but
neither are
extreme enough
to warrant any
Checking Assumptions
To check the equality of variance for
the difference treatment
combinations we can examine the
xijk xij
residuals plotted vs. theeijk
different
treatment combination
means
There appears to be more
variation for the dissolve times
for type C capsules being
dissolved in gastric fluid. These
combination produced the two
mild outliers seen in the normal
quantile plot. Generally we
worry when the variation
increases with the treatment
combination mean.
Degree of Severity
Effect Plot
Residuals look
approximately
normal.
Residuals
indicate constant
variation within
each treatment
combination.
Summary
These ideas can be extended to
more than
two factors.
When interactions exist, the main
effects are involved are important,
but cannot discussed separately.
Multiple comparisons can still be
conducted