# AFNI and NIfTI Server for NIMH/NIH/PHS/DHHS/USA/Earth

##### Personal tools
You are here: Home » SSCC » General Linear Testing in Group Analysis

# General Linear Testing in Group Analysis

##### Document Actions

The assumption of data normality in the analysis of variance (ANOVA) can be frequently violated but usually with minor effects. There are a few other assumptions about group analysis, among which the following two need more attention:

(1) Homogeneity of covariance for between-subjects factor: all levels of the between-subjects factor have the same variance. This is essentially the same assumption in two-sample t test (3dttest) with the same variance assumption of the two samples.

According to David C. Howell, if the population distributions tend to be symmetric, or at least similarly shaped or unidirectionally skewed, and if maximum variance among the populations is less than 4 times the minimum, the consquence of variance heterogeneity, when sample sizes are equal, is not very serious. However, inequality of sample size raises a huge concern if the homogeneity of variance assumption is violated. In case of possible violation of this assumption, try to aviod the possibility of unequal sample sizes.

(2) Sphericity (circularity) for within-subject factor - it requires the homogeneity of variance among the differences between all possible level pairs of the within-subject factor. However, a more useful and more convenient condition is a relatively stronger restriction (sufficient but not necessary): it requires both the homogeneity of variance (all levels of the within-subject factor have equal variance) and the homogeneity of covariance (the correlations are equal among each possible pair of the within-subject factor levels). This stronger restriction is called compound symmetry because the covariance matrix for the within-subject factor levels is symmetrical.

When all assumptions are met all the AFNI ANOVA programs can be safely employed to obtain F statistics for main effects and interactions. Nevertheless, when a contrast or simple effect involves only a portion of the whole dataset, we recommend the following testing principle to reduce the potential risk of sphericity violation:

Any effect involving a portion of the data is tested exclusively based on that portion.

Even if a within-subject factor passes sphericity test, the precautious practice of the above principle generates robust results. When sphericity assumption is violated especially if there is different correlation across factor levels, the above practice is immune to the violation. Therefore simple effects and contrasts, if possible, should be tested with one-sample, two-sample, or paired t test (3dttest). In other words, when appropriate contrasts from individual subject analysis (output of 3dDeconvolve) can be directly brought into group analysis.

In the same spirit we have modified 3dANOVA2 and 3dANOVA3 so that the options of -amean, -bmean, -adiff, -bdiff, -acontr and -bcontr are aligned up with the above principle for one-way within-subject ANOVA (3dANOVA2 -type 3) and two-way within-subject ANOVA (3dANOVA3 -type 4) and two-way mixed-effects ANOVA (3dANOVA3 -type 5). A justification for the modification for simple effect testing (-amean and -bmean) is discussed here. These modifications guard 3dANOVA2  and 3dANOVA3 against any potential risk of sphericity violation as much as possible, and also lift the old constraint (all coeficients should add up to 0) on option -acontr and -bcontr in the two programs. Keep in mind all these modifications on -amean, -bmean, -adiff, -bdiff, -acontr and -bcontr are essentially equivalent to running multiple corresponding t tests with 3dttest. In other words, you could run separate t tests with 3dttest instead of 3dANOVA2 or 3dANOVA3, but the later is definitely much neater with all results bundled in one single output file.

Another fact to notice here is that the tests done through -amean, -bmean, -adiff, and -bdiff are simply special cases for -acontr and -bcontr. Essentially -acontr and -bcontr would be good enough for all general linear tests. So literally -acontr and -bcontr should be more suitably called -glt in the sense all coefficients don't necessarily sum up to 0, comparable to the option in 3dDeconvolve, but we just decided to carry on the notation in 3dANOVA2 and 3dANOVA3.

In fact in the old version of the three ANOVA programs -mean, -diff, and -contr also bear the same underlying formulas: -mean and -diff were special cases of -contr. This was troublesome as demonstrated in Simple Effect testing at Group Level. Moreover, when general linear test coefficients do not add up to 0, the same problem would occur. Let's start with the same one-way within-subject (repeated-measures) ANOVA model (3dANOVA2 -type 3)

Yij = μ + αi+ βj + εij

where,

Yij independent variable – regression coefficient (% signal change) from individual subject analysis;
μ constant – grand mean;
αi constants subject to Σαi = 0 – simple effect of factor A at level i, i = 1, 2, ..., a
βj independent N(0, σp2) – random effect of subject j, j = 1, 2, ..., b;
εij independent N(0, σ2) – random error or within-subject variability or interaction between the factor of interest and subject.

with following assumptions:

E(Yij) = μ + αi, Var(Yij) = σp2 + σ2, Cov(Yij, Yi'j) = σp2 (i ‡ i'), Cov(Yij,,Yi'j') = 0 (j ‡ j');
Correlation between any two levels (αi and αj) of factor A: σp2/(σp2 + σ2).

Now consider a general linear null hypothesis H0: Σciαi = 0. The test in 3dANOVA2 -type 3 was

t = ΣciYi·/sqrt(Σci2 MSAS)

where MSAS is the interaction between the factor of interest and subject. As

E(ΣciYi·) = μΣcj,
Var(ΣciYi·) = (Σci)2σp2 + (Σci22, E(MSAS) = σ2

Var(ΣciYi·) = E(MSAS) if and only if Σci = 0. That is, ignoring sphericity issue, the above t test is legitimate if and only if Σci = 0, otherwise subject variability -- (Σci)2σp2 in Var(ΣciYi·) -- is not accounted for in the test, leading to inflated t value.

In the modified version of the programs, the above inflation automatically resolves with the new strategy. Furthermore, two new options were added options in 3dANOVA3, -aBcontr and -Abcontr, for types 4 and 5. Their usage is:

-aBcontr c1 c2...ca : j contrast_label  --  2nd order contrast in factor A, at fixed B level j

-Abcontr i : c1 c2...cb contrast_label --  2nd order contrast in factor B, at fixed A level i

If sphericity violation is a concern, when there are only two levels across all between- and within-subject factors, contrast testing in all other ANOVA programs in AFNI (3dRegAna and GroupAna of the Matlab package) are consistent with the above principle. Bear in mind the coeficients of a contrast should always add up to 0 in GroupAna.

1. David C. Howell, Statistical Methods for Psychology, Wadsworth Publishing; 5th edition, 2001

Created by Brian Pittman