Page 171 - Applied Statistics Using SPSS, STATISTICA, MATLAB and R
P. 171
4.5 Inference on More than Two Populations 151
4.5.2.2 Post Hoc Comparisons
Frequently, when performing one-way ANOVA tests resulting in the rejection of
the null hypothesis, we are interested in knowing which groups or classes can then
be considered as distinct. This knowledge can be obtained by a multitude of tests,
known as post-hoc comparisons, which take into account pair-wise combinations
of groups. These comparisons can be performed on individual pairs, the so-called
contrasts, or considering all possible pair-wise combinations of means with the aim
of detecting homogeneous groups of classes.
Software products such as SPSS and STATISTICA afford the possibility of
analysing contrasts, using the t test. A contrast is specified by a linear combination
of the population means:
H 0: a 1µ 1 + a 2µ 2 + … + a kµ k = 0. 4.35
Imagine, for instance, that we wanted to compare the means of populations 1
and 2. The comparison is expressed as whether or not µ 1 = µ 2, or, equivalently,
µ 1 −µ 2 = 0; therefore, we would use a 1 = 1 and a 2 = −1. We can also use groups of
classes in contrasts. For instance, the comparison µ 1 = (µ 3 + µ 4)/2 in a 5 class
problem would use the contrast coefficients: a 1 = 1; a 2 = 0; a 3 = −0.5; a 4 = −0.5;
a 5 = 0. We could also, equivalently, use the following integer coefficients: a 1 = 2;
a 2 = 0; a 3 = −1; a 4 = −1; a 5 = 0.
Briefly, in order to specify a contrast (in SPSS or in STATISTICA), one assigns
integer coefficients to the classes as follows:
i. Classes omitted from the contrast have a coefficient of zero;
ii. Classes merged in one group have equal coefficients;
iii. Classes compared with each other are assigned positive or negative values,
respectively;
iv. The total sum of the coefficients must be zero.
R has also the function pairwise.t.test that performs pair-wise
comparisons of all levels of a factor with adjustment of the p significance for the
multiple testing involved. For instance, pairwise.t.test(ART1,CLf)
would perform all possible pair-wise contrasts for the example described in
Commands 4.5.
It is possible to test a set of contrasts simultaneously based on the test statistic:
R
q = X , 4.36
s / n
p
where R is the observed range of the means. Tables of the sampling distribution
X
of q, when the null hypothesis of equal means is true, can be found in the literature.
It can also be proven that the sampling distribution of q can be used to establish
the following 1−α confidence intervals: