(B x C x S) Factorial ANOVA

advertisement
Multivariate approach to Mixed ANOVA with two Within-Subjects
and one Between-Subjects Factors: Howell p. 486, 8th ed.
The design is Groups x Cycle x Phase, 3 x 2 x 4, and the dependent variable is a measure of
the frequency of bar pressing (for food) for a rat in an experimental box.
During the Phase 1 of the experiment, each rat was placed in Box A and, while the animal was
bar pressing, a tone (or, in Group L-A-B a light) was presented and paired with shock.
During the second phase of the experiment, animals in Group L-A-B and Group A-B were
tested in a different box, Box B where the tone stimulus was presented without the shock. It was
expected that the tone would initially suppress bar pressing in these animals (but only somewhat in
the group for which shock had been paired with a light rather than with a tone).
Group A-A rats were tested in Box A in both phases.
The training just described was repeated for three more cycles. It was expected that across
cycles the rats in Groups A-B and L-A-B would learn that Box B is safe and bar pressing rates would
increase, but rats in Group A-A would continue to have low rates of bar pressing.
proc format; value gr 1='A-B' 2='A-A' 3='L-A-B';
data sup; infile 'C:\Users\Vati\Documents\StatData\MAN_2W1B.dat';
INPUT group c1p1 c1p2 c2p1 c2p2 c3p1 c3p2 c4p1 c4p2;
format group gr.;
****************************************************************************;
proc anova; class group;
model c1p1 -- c4p2 = group / nouni; repeated cycle 4, phase 2 / printe;
The first column of the data file contains the level of the Group variable (between-subjects)
followed by subjects’ scores on Cycle-1/Phase-1, Cycle-1/Phase-2, Cycle-2/Phase 1, …
Cycle-4/Phase-2. We have 4 x 2 = 8 cells in the matrix of repeated factors, represented by 8
dependent variables, C1P1 through C4P2, in the INPUT and MODEL statements. The REPEATED
statement indicates that we have two within-subjects factors, CYCLE with 4 levels, PHASE with 2
levels. The comma separating one within-subject factor from another must be there.
The order of the dependent variables is very important: The further to the right a repeated
factor is in the REPEATED statement, the more rapidly its index values must change. Phase, the
right-more factor, changes more rapidly (1,2,1,2,1,2,1,2) than does Cycle, the left-more factor
(1,1,2,2,3,3,4,4). Check the “REPEATED MEASURES LEVEL INFORMATION” output page to
assure that the within-subjects factors are properly defined.
The ANOVA Procedure
Class Level Information
Class Levels Values
group
3 A-A A-B L-A-B
Number of Observations Read 24
Number of Observations Used 24
The ANOVA Procedure
Repeated Measures Analysis of Variance
Repeated Measures Level Information
Dependent Variable c1p1 c1p2 c2p1 c2p2 c3p1 c3p2 c4p1 c4p2
Level of cycle
1
1
2
2
3
3
4
4
Level of phase
1
2
1
2
1
2
1
2
Sphericity Tests
Variables
DF Mauchly's Criterion Chi-Square Pr > ChiSq
Orthogonal Components
5
0.6880092
7.3751845
0.1942
 There is no problem with the sphericity assumption for the Cycle Effect.
 Sphericity is not an issue for the main effect of Phase, since there are only two phases.
MANOVA Test Criteria and Exact F Statistics for the Hypothesis of no cycle Effect
H = Anova SSCP Matrix for cycle
E = Error SSCP Matrix
S=1 M=0.5 N=8.5
Statistic
Wilks' Lambda
Value
F Value
Num DF
Den DF
Pr > F
0.33701445
12.46
3
19
<.0001
MANOVA Test Criteria and F Approximations for the Hypothesis of no cycle*group Effect
H = Anova SSCP Matrix for cycle*group
E = Error SSCP Matrix
S=2 M=0 N=8.5
Statistic
Value
F Value
Num DF
Den DF
Pr > F
Wilks' Lambda
0.56393662
2.10
6
38
0.0759
Pillai's Trace
0.47621936
2.08
6
40
0.0767
Hotelling-Lawley Trace
0.70204234
2.17
6
23.636
0.0822
Roy's Greatest Root
0.57907665
3.86
3
20
0.0250
NOTE: F Statistic for Roy's Greatest Root is an upper bound.
NOTE: F Statistic for Wilks' Lambda is exact.
MANOVA Test Criteria and Exact F Statistics for the Hypothesis of no phase Effect
H = Anova SSCP Matrix for phase
E = Error SSCP Matrix
S=1 M=-0.5 N=9.5
Statistic
Wilks' Lambda
Value
F Value
Num DF
Den DF
Pr > F
0.13920606
129.86
1
21
<.0001
MANOVA Test Criteria and Exact F Statistics for the Hypothesis of no phase*group Effect
H = Anova SSCP Matrix for phase*group
E = Error SSCP Matrix
S=1 M=0 N=9.5
Statistic
Wilks' Lambda
Value
F Value
Num DF
Den DF
Pr > F
0.31824635
22.49
2
21
<.0001
Sphericity Tests
Variables
DF Mauchly's Criterion Chi-Square Pr > ChiSq
Orthogonal Components
5
0.4846221
14.286499
0.0139
 Sphericity is an issue for the Cycle x Phase effect (and any effects within which it is contained).
While there are only two levels of Phase, there are 8 Cycle x Phase cells.
MANOVA Test Criteria and Exact F Statistics for the Hypothesis of no cycle*phase Effect
H = Anova SSCP Matrix for cycle*phase
E = Error SSCP Matrix
S=1 M=0.5 N=8.5
Statistic
Wilks' Lambda
Value
F Value
Num DF
Den DF
Pr > F
0.58602897
4.47
3
19
0.0154
MANOVA Test Criteria and F Approximations for the Hypothesis of no cycle*phase*group
Effect
H = Anova SSCP Matrix for cycle*phase*group
E = Error SSCP Matrix
S=2 M=0 N=8.5
Statistic
Value
F Value
Num DF
Den DF
Pr > F
Wilks' Lambda
0.42511798
3.38
6
38
0.0091
Pillai's Trace
0.67842819
3.42
6
40
0.0080
Hotelling-Lawley Trace
1.10871778
3.43
6
23.636
0.0139
Roy's Greatest Root
0.80683333
5.38
3
20
0.0070
NOTE: F Statistic for Roy's Greatest Root is an upper bound.
NOTE: F Statistic for Wilks' Lambda is exact.
The ANOVA Procedure
Repeated Measures Analysis of Variance
Tests of Hypotheses for Between Subjects Effects
Source DF
group
Error
2
Anova SS Mean Square F Value Pr > F
4616.76042
2308.38021
21 15723.35938
748.73140
3.08 0.0670
The ANOVA Procedure
Repeated Measures Analysis of Variance
Univariate Tests of Hypotheses for Within Subject Effects
Source
DF
Anova SS Mean Square F Value Pr > F
Adj Pr > F
G - G H-F-L
cycle
3 2726.973958
908.991319
12.03 <.0001 <.0001 <.0001
cycle*group
6 1047.072917
174.512153
2.31 0.0445 0.0612 0.0522
Error(cycle) 63 4761.328125
75.576637
Greenhouse-Geisser Epsilon
0.7872
Huynh-Feldt-Lecoutre Epsilon 0.8934
Source
DF
Anova SS Mean Square F Value Pr > F
phase
1 11703.13021 11703.13021
phase*group
2
4054.38542
2027.19271
Error(phase) 21
1892.60937
90.12426
Source
DF
129.86 <.0001
22.49 <.0001
Anova SS Mean Square F Value Pr > F
Adj Pr > F
G - G H-F-L
cycle*phase
3
741.515625
247.171875
4.04 0.0109 0.0222 0.0181
cycle*phase*group
6 1273.781250
212.296875
3.47 0.0051 0.0133 0.0100
Error(cycle*phase) 63 3859.078125
61.255208
Greenhouse-Geisser Epsilon
0.7124
Huynh-Feldt-Lecoutre Epsilon 0.7955
 Excepting the main effect of group, every effect is statistically significant, even the triple
interaction.
Howell chose to evaluate the simple Cycle x Group interaction at each level of Phase.
Look at the program to see how I did this by dropping variables from the left side of the model
statement.
Simple effects at Phase 1 -- Shock
proc anova; class group;
model c1p1 c2p1 c3p1 c4p1 = group / nouni; repeated cycle 4;
The ANOVA Procedure
Class Level Information
Class Levels Values
group
3 A-A A-B L-A-B
Number of Observations Read 24
Number of Observations Used 24
The ANOVA Procedure
Repeated Measures Analysis of Variance
Repeated Measures Level Information
Dependent Variable c1p1 c2p1 c3p1 c4p1
Level of cycle
1
2
3
4
MANOVA Test Criteria and Exact F Statistics for the Hypothesis of no cycle Effect
H = Anova SSCP Matrix for cycle
E = Error SSCP Matrix
S=1 M=0.5 N=8.5
Statistic
Wilks' Lambda
Value
F Value
Num DF
Den DF
Pr > F
0.70304067
2.68
3
19
0.0764
MANOVA Test Criteria and F Approximations for the Hypothesis of no cycle*group Effect
H = Anova SSCP Matrix for cycle*group
E = Error SSCP Matrix
S=2 M=0 N=8.5
Statistic
Value
F Value
Num DF
Den DF
Pr > F
Wilks' Lambda
0.74031448
1.03
6
38
0.4226
Pillai's Trace
0.26196650
1.00
6
40
0.4358
Hotelling-Lawley Trace
0.34769622
1.08
6
23.636
0.4045
Roy's Greatest Root
0.33859661
2.26
3
20
0.1130
NOTE: F Statistic for Roy's Greatest Root is an upper bound.
NOTE: F Statistic for Wilks' Lambda is exact.
The ANOVA Procedure
Repeated Measures Analysis of Variance
Tests of Hypotheses for Between Subjects Effects
Source DF
Anova SS Mean Square F Value Pr > F
group
458.39583
229.19792
21 11695.59375
556.93304
Error
2
0.41 0.6679
Repeated Measures Analysis of Variance
Univariate Tests of Hypotheses for Within Subject Effects
Source
DF
Anova SS Mean Square F Value Pr > F
Adj Pr > F
G - G H-F-L
cycle
3
403.614583
134.538194
1.74 0.1679 0.1801 0.1735
cycle*group
6
415.604167
69.267361
0.90 0.5036 0.4876 0.4967
Error(cycle) 63 4871.031250
77.317956
Greenhouse-Geisser Epsilon
0.7971
Huynh-Feldt-Lecoutre Epsilon 0.9065
The prediction was that all groups would show high suppression of bar-pressing on all cycles
during the shock phase (1), but that during the non-shock phase (2) Group 2 (A-A) should show more
suppression (lower scores) than the other groups, with the difference between Group 2 and the other
groups increasing across cycles. Given this prediction, one expects no effects at all for the data from
the first phase and a Cycle x Group interaction for the data from the second phase -- and that is
exactly what we get. As shown above, the prediction holds for Phase 1 (shock).
Simple effects at Phase 2 -- No Shock -- and simple, simple main
effects of group at each level of Cycle for Phase 2
with pairwise comparisons among Groups.
proc anova; class group; model c1p2 c2p2 c3p2 c4p2 = group; repeated cycle 4;
means group / lsd lines;
The ANOVA Procedure
Class Level Information
Class Levels Values
group
3 A-A A-B L-A-B
Number of Observations Read 24
Number of Observations Used 24
Dependent Variable: c1p2
Source
DF Sum of Squares Mean Square F Value Pr > F
Model
2
1125.750000
562.875000
Error
21
4081.875000
194.375000
Corrected Total 23
5207.625000
 The groups do not differ significantly at Cycle 1, Phase 2.
2.90 0.0775
Dependent Variable: c2p2
Source
DF Sum of Squares Mean Square F Value Pr > F
Model
2
1476.333333
738.166667
Error
21
2466.625000
117.458333
Corrected Total 23
3942.958333
6.28 0.0073
t Tests (LSD) for c2p2
Alpha
0.05
Error Degrees of Freedom
21
Error Mean Square
117.4583
Critical Value of t
2.07961
Least Significant Difference 11.269
Means with the same letter
are not significantly different.
t Grouping Mean
A
N group
46.875 8 L-A-B
A
A
41.125 8 A-B
B
28.125 8 A-A
 The groups do differ significantly at Cycle 1, Phase 2. As predicted, rate of bar pressing was
lower in the A-A group than in the other two groups. The group B mean is 15.9 points lower
than the mean of the other two groups (hand calculation).
Dependent Variable: c3p2
Source
DF Sum of Squares Mean Square F Value Pr > F
Model
2
4105.583333 2052.791667
Error
21
1700.250000
Corrected Total 23
5805.833333
25.35 <.0001
80.964286
Means with the same letter
are not significantly different.
t Grouping Mean
A
N group
50.375 8 L-A-B
A
A
46.125 8 A-B
B
20.750 8 A-A
 Same pattern of results in Cycle 2, but the difference between the Group B mean and the
mean of the other two groups has increased to 27.5, due to the rats in Groups L-A-B and A-B
having learned that Box B is safe (and thus bar-pressing more in Box B).
Dependent Variable: c4p2
Source
DF Sum of Squares Mean Square F Value Pr > F
Model
2
3410.333333 1705.166667
Error
21
1421.000000
Corrected Total 23
4831.333333
67.666667
25.20 <.0001
Means with the same letter
are not significantly different.
t Grouping Mean
A
N group
51.750 8 A-B
A
A
46.500 8 L-A-B
B
24.250 8 A-A
 Same pattern of results again, with the difference between the Group B mean and the mean of
the other two groups by 24.9 points, about the same as in the previous cycle.
Simple, simple main effect of Cycle for each Group during Phase 2
An alternative, perhaps better, way to dissect the significant Group x Cycle interaction for the
data from the second phase is to evaluate the simple, simple main effects of Cycle at each level of
Group (after sorting the data by group). I have included such an analysis, and it shows exactly what
was predicted, a significant increase in bar pressing across cycles in Groups A-B and L-A-B
(with the univariate test), but not in Group A-A. I did no pairwise comparisons here, as I decided
they would not add anything of value.
The ANOVA Procedure
group=A-B
Number of Observations Read 8
Number of Observations Used 8
Repeated Measures Analysis of Variance
group=A-B
Repeated Measures Level Information
Dependent Variable c1p2 c2p2 c3p2 c4p2
Level of cycle
1
2
3
4
MANOVA Test Criteria and Exact F Statistics for the Hypothesis of no cycle Effect
H = Anova SSCP Matrix for cycle
E = Error SSCP Matrix
S=1 M=0.5 N=1.5
Statistic
Wilks' Lambda
Value
F Value
Num DF
Den DF
Pr > F
0.00642851
257.60
3
5
<.0001
Repeated Measures Analysis of Variance
Univariate Tests of Hypotheses for Within Subject Effects
group=A-B
Source
DF
Anova SS Mean Square F Value Pr > F
Adj Pr > F
G-G
cycle
3 3789.125000 1263.041667
Error(cycle) 21
378.875000
H-F
70.01 <.0001 <.0001 <.0001
18.041667
Greenhouse-Geisser Epsilon 0.7361
Huynh-Feldt Epsilon
1.0897
MANOVA Test Criteria and Exact F Statistics for the Hypothesis of no cycle Effect
H = Anova SSCP Matrix for cycle
E = Error SSCP Matrix
S=1 M=0.5 N=1.5
Statistic
Wilks' Lambda
Value
F Value
Num DF
Den DF
Pr > F
0.44485179
2.08
3
5
0.2216
Repeated Measures Analysis of Variance
Univariate Tests of Hypotheses for Within Subject Effects
group=A-A
Source
DF
Anova SS Mean Square F Value Pr > F
Adj Pr > F
G-G
cycle
3
291.250000
97.083333
Error(cycle) 21 2368.250000
112.773810
H-F
0.86 0.4767 0.4451 0.4729
Greenhouse-Geisser Epsilon 0.6759
Huynh-Feldt Epsilon
0.9534
Repeated Measures Analysis of Variance
group=L-A-B
Repeated Measures Level Information
Dependent Variable c1p2 c2p2 c3p2 c4p2
Level of cycle
1
2
3
4
MANOVA Test Criteria and Exact F Statistics for the Hypothesis of no cycle Effect
H = Anova SSCP Matrix for cycle
E = Error SSCP Matrix
S=1 M=0.5 N=1.5
Statistic
Wilks' Lambda
Value
F Value
Num DF
Den DF
Pr > F
0.27183574
4.46
3
5
0.0704
Univariate Tests of Hypotheses for Within Subject Effects
group=L-A-B
Source
DF
Anova SS Mean Square F Value Pr > F
Adj Pr > F
G-G
cycle
3
889.750000
296.583333
Error(cycle) 21 1002.250000
47.726190
H-F
6.21 0.0034 0.0140 0.0064
Greenhouse-Geisser Epsilon 0.6179
Huynh-Feldt Epsilon
0.8310
The interaction plot on the next page illustrates the simple interaction well.
Youse guys are gonna pay a price for
having shocked my friends. One of these
days I am going to find you in a dark alley.
Sincerely, Mickey Rat
Karl L. Wuensch, November, 2013.
Fair Use of this Document
Download