Professional Documents
Culture Documents
Two-way ANOVA
Example - Capsule Dissolving Experiment (Capsule.JMP)
In this experiment researchers are interested in studying the effect of two factors or
treatments on the time to begin dissolving a capsule which is recorded as the time until
bubbles first appear (seconds). The factors of interest to the researchers are digestive
juice type - gastric or duodenal (Factor A) and capsule type - C or V (Factor B).
To conduct the experiment 5 capsules of each type are randomly assigned to each juice
giving us 5 observations or replicates for each of the four treatment combinations
(Gastric & C, Gastric & V, Duodenal & C, Duodenal & V). The data obtained from the
experiment are shown below:
Capsule Type
Type of Digestive Juice C V Juice Type Means
39.5 47.4
45.7 43.5 Y1 45.7
Gastric 49.8 39.8
50.2 36.1
63.8 41.2
Y11 49.8 Y12 41.6
33.5 44
36.7 41.2 Y2 40.2
Duodenal 42 47.3
38.1 45.3
31.2 42.7
Y21 36.3 Y22 44.1
Capsule Type Means Y1 43.05 Y2 42.85 Grand Mean
X 42.95
By plotting the mean time until By plotting the mean time until
bubbles for both digestive juices, bubbles for both capsule types we see
we can see that mean dissolution that the mean dissolution times for
time for duodenal juice is slightly the capsule types are approximately
smaller than that for gastric (about equal.
5 seconds). 127
Our preliminary conclusions would be first that fluid type has a small effect on the
dissolution time with duodenal juice dissolving capsules about 5 seconds quicker on
average, and secondly that capsule type has little or no effect.
When considering the effect of two factors on the response we cannot do so marginally,
i.e. individually. It is possible, for example, that the effect of digestive juice is not the
same for both capsule types. If we consider the means for each of the treatment
combinations above we see that for type C capsules the duodenal juice dissolves the
capsule quicker, while the exact opposite is true for type V capsules, gastric juice
dissolves the capsules faster.
A better display shows the means for each treatment combination. Here we have a
separate profile for each digestive juice showing how the capsule effect depends on the
type of digestive juice we are using. This is what we call an interaction.
128
As always it is important to quantify any significant differences using pair-wise
comparisons and CI’s for the differences in the population/treatment means.
Analysis in JMP
To fit the two-way model for these data select Fit Model from the Analyze menu and put
the response Time to Bubbles in the Y box and then highlight both Fluid & Capsule and
select Full Factorial from the Macros pull-down menu as shown below.
Then click Run Model to obtain the results on the next page.
The p-values for the effects suggests that the Fluid*Capsule interaction is significant
(p = .0049), which implies the main effect tests for Fluid and Capsule are of little interest.
It is interesting to note that the main effect of Capsule is not significant (p = .9361). This
129
happens because the presence of the Fluid*Capsule interaction "masks" the main effect of
capsule as we have seen in marginal effect plots above. The main effect of fluid is only
partially masked by the Fluid*Capsule interaction and so it still tests as significant.
130
Here we see that Gastric,C and Duodenal,C mean dissolution times significantly differ.
In particular we estimate that the type C capsules in gastric fluid take between 3.57 and
23.429 seconds longer to dissolve on average. In contrast type V capsules appear to
dissolve equally well in either digestive juice.
If the interaction between the two factors is NOT significant we can use the Tukey’s
procedure to compare the means across the levels of each factor individually. This means
that we can use Tukey’s pair-wise comparisons to compare the mean response across the
levels of factor A and factor B individually.
Assumptions:
1. The observations between and within the treatment combinations are
independent.
2. The response is normally distributed for each treatment combination.
3. The variance of the response is the same for each treatment combination.
To check the constant variance assumption we can examine the residuals plotted vs. the
fitted values and each factor. The fitted values are simply the observed mean response at
each of the four treatment combinations and the residuals are the deviations from the
treatment combination means. The spread of the residuals, i.e. the spread of the observed
response values about their respective treatment combination means, should be uniform
indicating constant response variation for the different treatment combinations.
A plot of the residuals vs. the fitted values is given each time we fit a model in JMP. The
resulting plot is shown below:
There appears to be a potential outlier in this plot, otherwise this plot looks fine.
To examine the normality assumption we assess the normality of the residuals. Save the
residuals to the spreadsheet as shown below and use Analyze > Distribution to examine
them. With the exception of two mild outliers, normality seems satisfied.
131
STATISTICAL DETAILS (FYI, equal sample size case only)
where,
Yijk kth observed response value when level i of factor A and level j of factor B is used.
i effect due to the fact level i of Factor A was used.
j effect due to the fact level j of Factor B was used.
( ) ij effect due to the interaction of ith level of Factor A and the jth level of Factor B.
ijk the random error, represents the variation in the response values when the ith level of Factor A and
the jth level of Factor B are used.
We assume that ijk ~ N (0, ) , i.e. the errors are normal and their variation is constant.
2
See your text for formulae used to estimate these quantities and those used to test the
hypotheses. The three questions of interest in a two-way ANOVA can be formulated in
terms of these parameter values.
As in one-way ANOVA the test procedures decomposes total response variation into
components that measure how much variation in the response is due to Factor A, Factor
132
B, the interaction between Factors A & B, and random error.
a b n a b
a b a b n
n (X ij X i X j X ) 2 + ( X ijk X ij ) 2
i 1 j 1 i 1 j 1 k 1
SS effect
MS effect
df effect
When the null hypothesis of “no effect” is true the mean squares are all estimates of 2 ,
the common response variance for all treatment combinations. If there is a significant
effect then we expect the MS effect MS Error (within treatment combination
variation).
To compare the mean squares we use the ratio, which has an F-distribution.
MS effect
Fo ~ F-distribution (numerator df = df for the effect , denominator df = df for error)
MS Error
Fo >> 1 will lead to the conclusion that the effect in question significantly impacts the
response. Large Fo values lead to small p-values which support effect significance.
133
Example 2 – Comparing the Effectiveness of Three Forms of
Psychotherapy for Alleviating Depression
Rogerian (R) 56 58 59
47 54 55
45 49 68
46 61 63
49 52
62
Assertiveness Training 43 59 55
(A) 56 46 69
48 58 63
46 54 56
47 62
67
134
The data in JMP is entered as shown on the
left. The first column contains the Therapy
grown, the second column contains the
Degree of Severity of their depression, and
the last column denotes the MMPI
Depression score.
In JMP select Analyze > Fit Model and set up the dialog box as shown below. First
highlight both Therapy and Degree of Severity by holding down the <Shift> key and
select Full Factorial from the Macro pull-down menu as shown below.
135
Test results:
Interaction
Therapy
Degree of Severity
Interaction Plot
136
Because the interaction is not significant we can examine the main effects of therapy and
degree of severity separately.
The mean MMPI depression scores differ across therapy (p = .0422). In particular,
the mean depression scores for patients in the cognitive-behavioral group appear to
be significantly lower than that for the other to therapies.
As expected the initial severity of the depression highly significant (p < .0001). The
mean depression scores follow the expected trend after treatment with those with the
most severe initial depression having the highest mean depression and those with
mild initial depression the lowest.
We see that the mean nutrient depression score for cognitive-behavioral therapy was
significantly lower than that for patients undergoing Rogerian therapy. We estimate the
mean MMPI depression score is between .079 and 9.872 units smaller for patients
receiving cognitive-behavioral therapy vs. Rogerian regardless of the their initial
depression severity.
All levels of initial severity of depression significantly differ from one another in terms of
mean MMPI depression score following therapy regardless of what therapy they
received.
137