open-discussion
open-discussion > RE: 3 Group ANOVA
Sep 18, 2014 10:09 AM | Ged Ridgway
RE: 3 Group ANOVA
Hi Marisol,
With three groups, the null hypothesis for the main effect of group is that all three are equal, i.e. a=b=c. Writing it like that, with two equals signs, is a helpful hint that two rows are required in the F-contrast, the a=b row is [1 -1 0] and the b=c row is [0 1 -1]. I don't think you mentioned which software you are using, but with FSL, you enter the two rows as separate t-contrasts, add an F-contrast, and then tick the box next to each t-contrast to include it in the F-contrast. With SPM, you can enter the two rows on two lines of the contrast manager interface:
You can stop reading now if you want ;-) One potential source of confusion, which I mention in case you read anywhere else that the contrast should be different, is that contrasts are not uniquely defined. In the case of the two-group test that you mention, scaling the contrast (e.g. [0.5 -0.5] or [2 -2]) won't change the t- or p-values (though it will scale the contrast image). In the case of multi-row F-contrasts, it gets more complicated, as adding/subtracting (possibly scaled) rows to other rows doesn't change the F- or p-values, as long as the so-called row-space of the contrast doesn't change. That's a bit abstract, but a practical example is as follows. The a=b=c null hypothesis was effectively broken up as a=b and b=c above, where you can observe that these two equalities also imply a=c, but we could also have broken it up as a=b and a=c (with b=c being implied). The latter would give the F-contrast [1 -1 0; 1 0 -1]. You might also see versions like [2 -1 -1; -1 2 -1], or [2 -1 -1; 0 1 -1] which appears in the planned comparisons handout from the website that Giora mentioned.
If you have many groups, and want to avoid entering many rows by hand, a neat trick in MATLAB is that the main effect of group contrast for N groups can be obtained as:
All the best,
Ged
With three groups, the null hypothesis for the main effect of group is that all three are equal, i.e. a=b=c. Writing it like that, with two equals signs, is a helpful hint that two rows are required in the F-contrast, the a=b row is [1 -1 0] and the b=c row is [0 1 -1]. I don't think you mentioned which software you are using, but with FSL, you enter the two rows as separate t-contrasts, add an F-contrast, and then tick the box next to each t-contrast to include it in the F-contrast. With SPM, you can enter the two rows on two lines of the contrast manager interface:
[ 1 -1 0
0 1 -1]
0 1 -1]
You can stop reading now if you want ;-) One potential source of confusion, which I mention in case you read anywhere else that the contrast should be different, is that contrasts are not uniquely defined. In the case of the two-group test that you mention, scaling the contrast (e.g. [0.5 -0.5] or [2 -2]) won't change the t- or p-values (though it will scale the contrast image). In the case of multi-row F-contrasts, it gets more complicated, as adding/subtracting (possibly scaled) rows to other rows doesn't change the F- or p-values, as long as the so-called row-space of the contrast doesn't change. That's a bit abstract, but a practical example is as follows. The a=b=c null hypothesis was effectively broken up as a=b and b=c above, where you can observe that these two equalities also imply a=c, but we could also have broken it up as a=b and a=c (with b=c being implied). The latter would give the F-contrast [1 -1 0; 1 0 -1]. You might also see versions like [2 -1 -1; -1 2 -1], or [2 -1 -1; 0 1 -1] which appears in the planned comparisons handout from the website that Giora mentioned.
If you have many groups, and want to avoid entering many rows by hand, a neat trick in MATLAB is that the main effect of group contrast for N groups can be obtained as:
diff(eye(N))
For example:>> diff(eye(5))
ans =
-1 1 0 0 0
0 -1 1 0 0
0 0 -1 1 0
0 0 0 -1 1
which you can see tests a=b=c=d=e by splitting into a=b, b=c, c=d,
d=e. (The signs of each row are reversed compared to what I started
with above for the three-group case, but F-contrasts aren't
affected by that, as they are always effectively two-tailed.)0 -1 1 0 0
0 0 -1 1 0
0 0 0 -1 1
All the best,
Ged
Threaded View
| Title | Author | Date |
|---|---|---|
| Marisol Picado | Sep 17, 2014 | |
| Marisol Picado | Sep 17, 2014 | |
| Ged Ridgway | Sep 18, 2014 | |
| Marisol Picado | Sep 18, 2014 | |
| Ged Ridgway | Sep 18, 2014 | |
| Giora Galili | Sep 17, 2014 | |
| Marisol Picado | Sep 18, 2014 | |
| Giora Galili | Sep 17, 2014 | |
