Académique Documents
Professionnel Documents
Culture Documents
Anthony J. Wragg
A thesis submitted in partial fulfilment of the requirements for the degree of Master of
Applied Science (Statistics and Operations Research).
Declaration
The work contained in this thesis has not been submitted previously, in whole or in
part, in respect of any academic award.
To the best of my knowledge and belief, this thesis contains no material previously
published or written by any other person except where due reference is given.
Anthony J. Wragg
31st December 1999
3
Acknowledgments
I would like to thank my thesis supervisor Ms. Kaye E. Marion and Associate
Professor Panlop Zeephongsekul for their encouragement and guidance in the writing
of this minor thesis and throughout the rest of the course.
4
Abstract
This thesis considers both univariate and multivariate approaches to the analysis of a
set of repeated-measures data. Since repeated measures on the same subject are
correlated over time, the usual analysis of variance assumption of independence is
often violated. The models in this thesis demonstrate different approaches to the
analysis of repeated-measures data, and highlight their advantages and disadvantages.
Milk from two groups of lactating cows, one group vaccinated, the other not, was
analysed every month after calving for eight months in order to measure the amount
of bacteria in the milk. The primary goal of the experiment was to determine if a
vaccine developed by the Royal Melbourne Institute of Technology’s Biology
Department led to a significant decrease in mean bacteria production per litre of milk
produced compared to the control group.
A univariate model suitable for repeated measures data was initially tried, with mean
bacteria production in the treatment group not significantly different from the control
group (p < 0.68).
Finally, a generalised multivariate analysis of variance was carried out in order to fit
polynomial growth curves for both the control and the vaccinated groups and to test if
the growth curves were equal for the two groups. It was found that a slope-intercept
model was adequate to describe both growth curves and that the growth curve for the
treatment group did not differ significantly from that of the control group (p < 0.11).
5
Table of Contents
1. INTRODUCTION ..........................................................................................6
7. CONCLUSION.............................................................................................58
REFERENCES................................................................................................60
APPENDIX A...................................................................................................62
6
1. Introduction
Milk from two groups of lactating cows, one group vaccinated, the other not, was
analysed every month after calving for eight months in order to measure the amount
of bacteria in the milk. The primary goal of the experiment was to determine if a
vaccine developed by the Royal Melbourne Institute of Technology’s Biology
Department led to a significant decrease in mean bacteria production compared to the
control group.
Experiments such as this fit into the family of designs known in the literature as
repeated measures data, longitudinal models, or growth curves. Data from these
models generally arise whenever more than two observations of the same variable are
made on an individual subject or experimental unit. These models are especially
common in biology, agriculture, and medicine and most often occur when
observations on a group of subjects are repeated over a period of time.
Repeated measures data such as this require somewhat different statistical treatment
than normal because the observations are not independent. This lack of independence
lies at the core of repeated measures analysis, and is what differentiates it from the
more commonly used statistical analyses. The implications of a lack of independence
within a subject’s responses are serious, as will be explained in Chapter 4. For the
data collected by the RMIT biology department, this implies that the amount of
bacteria found in a litre of a cow’s milk will, at any given time, be correlated with the
amount of bacteria found in that cow’s milk at subsequent or preceding times. In
addition, the correlation between the amount of bacteria produced at different times
also tends to be stronger the shorter the time interval. In other words, the amount of
bacteria produced per litre of milk is more dependent on the amount of bacteria
produced one month ago than the amount of bacteria produced five months ago.
subjects. Randomisation ensures that in the long run there is no correlation between
the factor levels, so that observations with any given factor level are not more similar
to some factor levels than to others. Since time is treated as a factor with the eight
months considered the eight levels of time, randomisation is impossible – the
observations must follow their natural sequence. Thus, it is not possible to randomise
the order of monthly observations: they must follow the sequence month 2, month 3,
month 4… As a result of the lack of randomisation, the means of two milk samples
taken a month apart, for example, tend to be more highly correlated than those taken 6
months apart. As a consequence, the precision of the difference tends to drop as the
time interval increases, nullifying the use of a single standard error of difference for
the time factor.
This variation in correlation between levels of the time factor means that it is
inappropriate to analyse the data as if time was a randomised factor. This thesis
covers some of the most commonly used techniques. Frequently, there is no single
best approach to analysis. It depends on what questions need to be answered. Often, it
is useful to use two or more approaches with the same data.
The analysis carried out on a set of repeated measures data is determined largely by
the questions the researcher wants answered. For this study, the most important
question is that concerning the vaccine: is there a significant difference between the
mean number of cells found in a litre of milk produced by cows in the treatment group
compared to the control group, over time? Secondary questions may include such
things as the change in cell production over the months irrespective of group
membership. The first question when studying repeated measures, or in fact any, data,
should not be how to analyse the data, but what is the experimenter is interested in
finding out (Lindsey, 1993). Once this is known, together with knowledge of the
techniques available, the selection of an appropriate technique becomes much easier.
8
The biology department of RMIT has developed a vaccine which is thought to reduce
the number of cells of mastitis, hereto known as ‘cells’ found in a cow’s milk. The
vaccine was tested on a randomly chosen sample of 23 cows, while a randomly
chosen sample of 18 cows was used as the control. Readings of the cell count of each
cow’s milk were taken at 2, 3, 4, 5, 6, 7, 8, and 9 months after calving.
One of the attractive features of repeated measures data is that they can be displayed
in a graphical plot which is readily interpretable, without requiring a great effort and
little training is required to interpret the plots (Lindsey, 1993). Data plotting is
essential in order to get some feeling for what patterns are present in the data, whether
expected trends have occurred, what unexpected features are apparent and what
questions deserve analytical consideration. It should always precede detailed analysis
of the data. Figure 1 (a)-(d) shows various plots of the two groups.
Figure 1.
CONTROL TREATMENT
3500 3500
3000 3000
2500 2500
2000 2000
1500 1500
1000 1000
500 500
0 0
2 3 4 5 6 7 8 9 2 3 4 5 6 7 8 9
MONTH MONTH
(a) (b)
3500 3500
3000 3000
2500 2500
2000 2000
CELLS
CELLS
1500 1500
1000 1000
500 500
0 0
2 3 4 5 6 7 8 9 2 3 4 5 6 7 8 9
MONTH MONTH
(c) (d)
9
The skew towards higher values of cells can be seen over most of the time periods,
although some months are worse than others. The boxplots, where the boxes contain
50% of the data, tend to vary over time in the control group. The pattern of variation
is roughly similar for the treatment group. The treatment group appears to have
comparatively smaller variances over time than the control group. If it were not for
the larger variance at month 3, the variance of the control group would be increasing
with time. The variance of the treatment group looks as if it decreases slightly over
time. Plots of the individual cow’s results show that the control group cows cell
production increases linearly over time, although the trend is not patent. The treatment
group does not show any apparent increase over time. There appears to be little
evidence of a quadratic or cubic growth curve from the plots.
The outliers were noted and checked for accuracy with the RMIT Biology department
to make sure there were no transcription errors or similar problems. The outliers were
all legitimate observations.
The sample means of each group are plotted in Figure 2(a). Plotting the medians,
Figure 2(b) as well as the means allows one to look at the data from a slightly
different perspective, one that is resistant to outliers. Since the observations for any
given month are generally skewed, the medians are a useful adjunct. The control
group’s mean response is not as stable as the treatment group’s.
Figure 2.
MEANS MEDIANS
1000 1000
500
500
0
0
2 3 4 5 6 7 8 9
2 3 4 5 6 7 8 9
MONTH
MONTH
(a)
(b)
Fitting ordinary linear regression equations to the data gives an indication of the linear
trend for each group. Figure 3 (a) shows the control group has a positive slope which
highlights the increase in cells over time, while Figure 3(b) shows the treatment
group’s slope is negative and flatter. At first it might appear that a possible model for
these observations is the general linear model. The problem is, like ANOVA, that the
assumptions of linear regression require independence of the variables. In chapter 6
growth curves will be fitted to the data using a multivariate approach which does not
have the restrictive assumption of independence.
Figure 3.
3500 2500
3000
2000
2500
1500
CELLS
CELLS
2000
1500
1000
1000
500
500
0 0
2 3 4 5 6 7 8 9 2 3 4 5 6 7 8 9
MONTH MONTH
(a) (b)
Although plotting the data is imperative with any analysis, it does not allow the
analyst to make anything more than general statements summarizing the apparent
behaviour of the subjects being studied. What is really needed is to be able to quantify
the responses and formally test the research questions given in chapter 1 as
hypotheses. Chapter 3 describes the most simple method for doing this.
11
Table 1.
Month 2 3 4 5 6 7 8 9
t -0.80 0.14 -1.12 -1.56 -0.45 -0.47 1.02 1.21
p-value 0.43 0.89 0.27 0.13 0.65 0.64 0.32 0.24
The time-by-time analysis indicates that mean cells count does not differ between the
control and treatment groups in any of the 8 months. This suggests that the two mean
response profiles are alike. Month 5 has a large t test statistic (t = -1.56), but not
enough to be significant.
Experiments utilising repeated measures designs differ from the usual ANOVA
models in that the levels of time cannot be randomly assigned to one or more the
experimental units in the experiment. In this case the levels of time cannot be
assigned at random to the time intervals, and thus the usual ANOVA models may not
be valid. Because of the non-random assignment of time, the errors corresponding to
the respective experimental units may have a covariance matrix which does not
conform to those for which the usual ANOVA analysis are valid.
The inherent dependence that is associated with repeated measures data introduces
extra complications into the analysis. Unfortunately, the simplifying properties arising
from data which are independently and identically distributed can no longer be relied
upon. To yield conclusions which are valid the analyst must take into account the
possible dependence within subjects. Fortunately, Diggle, Liang and Zeger (1994) and
Vonesh and Chinchilli (1997) have outlined methods which modify the problem so
that independence based methods like ANOVA can be used.
BLOCK 1
D F A E B C H G
COW 1
Month 4 Month 2 Month 9 Month 3 Month 5 Month 7 Month 6 Month 8
The times, if they are regarded as factor levels, cannot be randomised as above, an
essential requirement of ANOVA. They must follow their natural sequence. The first
measurement is the first measurement, it cannot be taken third. In general, these extra
complications mean that the simple univariate ANOVA F-tests will no longer be valid.
An approach that takes advantage of the fact that the p = 8 measurements on each cow
are repeated observations on the same response variable, namely, cells, is given in
Vonesh and Chinchilli (1997). The additive model is
where
In the general model for this experiment, 18 cows were randomly assigned to the
control group and 23 cows were randomly assigned to the treatment group, and each
cow’s milk was tested on eight occasions (months).
Anova Table
_____________________________________________________________________
Source df S.S. F
_____________________________________________________________________
SSM
Month p-1 SSM (N − r)
SSE
( N − r ) SSG
Group r–1 SSG
(r − 1) SSC (G )
( N − r ) SSG × SSM
Group × Month (p - 1)(r - 1) SSG × SSM
(r − 1) SSE
Note that in this model there are two error terms, where δ i ( j ) represents the random
error due to cow i within group j. In addition, there is the assumption that the δ i ( j ) ’s
For this approach to be appropriate, Milliken and Johnson (1984) claim that the
1 ρ ρ ρ
ρ 1 ρ ρ
Σ = σ ε2 ρ ρ 1 ρ
ρ ρ ρ ρ 1
The compound symmetry condition implies that the random variables are equally
correlated and have equal variances. In other words, the variances of the differences
between pairs of errors, such as ε ijk - ε ijk ′ are equal for all k and k′, k ≠ k′. The
variance structure is also called the uniform-variance, equi-variance or the equi-
correlation structure.
Assuming that the univariate repeated measures approach is appropriate, i.e. Σ has the
compound symmetry structure described above, the F tests for the hypothesis of
parallelism (no group × month interaction), coincidence (no differences between
groups), and constancy (no differences among months) are more powerful than the
corresponding multivariate tests where no structure is assumed for Σ (Vonesh &
Chinchilli, 1997).
17
Tests exist for compound symmetry. Firstly, the above model will be applied to the
raw data and an analysis of the residuals for the usual assumptions done before testing
the variance structure of the residuals for compound symmetry.
month fixed 8 2 3 4 5 6 7 8 9
group fixed 2 0 1
cow(group) random 41 1 2 3 4 5 6 7 8 9 10 11 12 13 14
15 16 17 18 19 20 21 22 23 24 25 26 27
28 29 30 31 32 33 34 35 36 37 38 39 40 41
The ANOVA table shows a significant effect for the group × month interaction, as
well as month alone. Before any conclusions can be made, an analysis of the residuals
needs to be made. Figure 4 (a) shows the residuals plotted against the fitted values
from the above model. There is evidence of increasing variance as the predicted
values increase. There also appear to be many outliers with larger than expected
positive values. Also alarming is the obvious lack of normality of the residuals in
Figure 4(b).
18
Figure 4.
Residuals Versus the Fitted Values Normal Probability Plot of the Residuals
3000 3
2
2000
Normal Score
1
Residual
1000 0
-1
0
-2
-1000 -3
Since the residuals from the raw data are highly skewed as well as exhibiting
increased variance with higher values of fits, and a strong departure from normality, a
transformation was applied. The raw data were transformed by applying loge to the
cell counts. The transformed data are shown in Figure 5 (a)-(d).
Figure 5.
CONTROL TREATMENT
9 9
8 8
7 7
ln(CELLS)
ln(CELLS)
6 6
5 5
4 4
3 3
2 2
2 3 4 5 6 7 8 9 2 3 4 5 6 7 8 9
MONTH MONTH
(a) (b)
9 9
8 8
7 7
ln(CELLS)
ln(CELLS)
6 6
5
5
4
4
3
3
2
2
2 3 4 5 6 7 8 9
2 3 4 5 6 7 8 9
MONTH
MONTH
(c)
19
The loge transformation has had the effect of making the data more symmetrical, in
that it does not have the highly skewed values previously seen with the raw data. Most
of the outliers have also disappeared. Note that the treatment group still has a smaller
variance over time than the control group.
The univariate ANOVA was then re-run with the transformed data. The transformed
data produced the following results for the repeated measures ANOVA .
The transformed data ‘ln(cells)’ produced a different set of test statistics than the raw
data. Most importantly, the month × group interaction is no longer significant (p =
0.234). This indicates that the loge of the number of cells found in a cow’s milk over
time does not depend on whether the cow was vaccinated or not. The main effect for
month is still highly significant (p = 0.000), indicating that at least two of the eight
months have unequal means. As with the raw data, there was no significant difference
in the mean number of cells produced between the two groups, ignoring time,
(p=0.684). The residual plots of the transformed data are seen in Figure 6(a) –(d).
Figure 6.
20
Residuals Versus the Fitted Values Normal Probability Plot of the Residuals
3
2
2
1
Normal Score
1
Residual
0
0
-1
-1
-2 -2
-3 -3
y = .5 26 + .0 14× time
(a) (b)
1
Residual
-1
-2
-3
2 3 4 5 6 7 8 9
month
(c)
The residuals for the transformed data do not exhibit the skewness of the raw data, nor
do the residuals increase in variance as the fitted values increase. The normal
probability plot also shows marked improvement, although the tails are less than
satisfactory. Many transformations were tried, but with little impact on the tails. The
variance of the residuals over both month and group appear reasonably uniform.
Some software packages, SPSS, for example, test for compound symmetry, while
others, like Minitab, do not. Since Minitab was used for this analysis, testing for
compound symmetry was carried out using the method outlined by Milliken and
Johnson (1984). The compound symmetry test can be applied to test the hypothesis
that Σ is compound symmetric, i.e. the variance-covariance matrix of the residuals is
approximately
21
1 ρ ρ ρ
ρ 1 ρ ρ
Σ = σ ε2 ρ ρ 1 ρ
ρ ρ ρ ρ 1
This is a likelihood ratio test and it rejects H0: Σ is compound symmetric, for
θ ≠ 1 where the range of θ is
1
≤θ ≤1
p −1
p 2 ( sii ) 2
θˆ =
[( p − 1)∑ p
i =1 ∑
p
s2
j =1 ij
]
where sij is the ij th element of the matrix Sε and sii is the mean of the diagonal
εˆij1
εˆ
ij 2
εˆij = εˆ ij 3
εˆ ijp
∑ ∑
r nj
j =1
εˆ εˆ
i =1 ijk ijk '
skk ' =
N −1
22
Q = (1- A)M
M = -v loge( θˆ )
p ( p + 1) 2 (2 p − 3)
A=
6v ( p − 1)( p 2 + p − 4)
p2 + p − 4
f=
2
and v is the degrees of freedom associated with the elements in Σ. To ensure division
by zero does not occur in calculating the formula for A, the condition p ≥ 2 must
hold. If Q > χα , f then the null hypothesis is rejected, and the resulting F tests will
2
no longer be valid. In the case where Q is significant, then the usual procedure is to
multiply the degrees of freedom by εˆ in an attempt to adjust for the lack of compound
symmetry. A non-significant unadjusted test implies a non-significant adjusted test
result. For the purposes of exposition, however, we shall complete the analysis.
23
The value for the test statistic outlined above is computed below
8(81)(13) 68
v = 273 θˆ = 0.6138 A= = 0.0108 f = = 34 M = 133.23
6(273)(7)(68) 2
Since Q = 131.80 > χ 0.05,34 = 44 the null hypothesis is rejected (p = 0.000) and, due
2
to the lack of compound symmetry, the usual F tests will not be valid. If the calculated
value of Q exceeds the tabulated chi-square value, then a multivariate analysis should
be used on the data (Milliken & Johnson, 1984).
When the repeated measures are over time, the errors can often be correlated through
an autoregressive error structure. The covariance matrix corresponding to errors with
a first order regressive process is
1 ρ ρ2 ρ p −1
ρ 1 ρ ρ p−2
σ ε 2
2
Σ= ρ ρ 1 ρ p −3
1− ρ2
ρ p −1 ρ p−2 ρ p −3 1
For this data set, the correlations among the residuals from the previous ANOVA are
as follows
24
MONTH 2 3 4 5 6 7 8 9
The correlations are certainly not uniform. For example, the correlation between
Month 3 and Month 6 is -0.799, while the correlation between Month 4 and Month 7
is only 0.060. This disparity is quite large, and not indicative of the variables being
equi-correlated. Also interesting is the way the correlations between Month 9 and the
previous months do not slowly decrease. Since some of the sample residual
correlations fall off with separation in time, an autoregressive error structure is a
possibility.
When the responses of a single subject are measured sequentially, the errors are often
correlated through an autoregressive structure rather than an error structure satisfying
the compound symmetry structure (Lindsey, 1993). Rather than test for an
autoregressive error structure, which can be difficult with only 8 observations per
series of responses, in addition to the fact that many software packages do not supply
a test for this in a repeated measures context, Milliken and Johnson (1984) suggest
analysing the data using multivariate data analysis methods when the number of
subjects exceed the number of repeated measures. The multivariate approach is often
preferable because it is conceptually simpler in that it imposes no restrictive
assumptions on the error covariance matrix – in fact it assumes the matrix to be
unstructured, contrast this to the ANOVA models which have several restrictive
assumptions. As was mentioned previously, a non-significant unadjusted test implies a
non-significant adjusted test result. If the experimenter was following the strategy
outlined above they could comfortably stop now, since the p value for group × month
is not significant. For the purposes of comparison, however, the multivariate approach
will be applied in the next chapter.
25
X ji = µ + τ i + e ji
where i = 1, 2, … nj and j = 1, 2, … r
and
E(X) = Θ̂ A
Where
X is a p × N matrix of observations
A is an r × N matrix which indicates group membership
and
26
Since there are only two groups being compared and p > 1, Johnson and Wichern
(1982) advise using a multivariate analogue of the two-sample t-test called Hotelling’s
T2. Hotelling’s generalised Student T2 is uniformly most powerful as well as being
robust to violations of the assumptions of multivariate normality and homogeneity of
variance-covariance matrices (Ito, 1980). The test statistic can be defined as follows.
If X1,1, X1,2, X1,3, … X1,n1 is a random sample of size n1 from an Np(µ 1, Σ) and
X2,1, X2,2, X2,3, … X2,n2 is a random sample of size n2 from an Np(µ 2, Σ)
Then
−1
1 1
T = [ X1 − X2 − ( µ1 − µ 2 )]' + S [ X1 − X2 − ( µ1 − µ 2 )]
2
n1 n2
is distributed as
(n1 + n2 − 2) p
Fp , n1 + n 2 − p −1
(n1 + n2 − p − 1)
This is the test statistic which will be used in the profile analysis of the data in the
next section. The variance-covariance matrix S used in the above equation is given by
1 N
S= ∑ (Xi − X)(Xi − X)' .
N − 1 i =1
The kinds of questions profile analysis answers depends on the kinds of research
questions asked. For this study the main questions are
(1) Do different groups have parallel profiles? This is known as the test for
parallelism and is the primary question answered by profile analysis (Timm,
1980). For this study, the hypothesis of parallel profiles translates into asking if
the control group and the vaccine group have the same pattern of means on the
various months. In other words, does the vaccine lead to the same pattern of mean
bug production over the course of the experiment as the control group? This is
equivalent to the interaction hypothesis in the repeated measures ANOVA carried
out in Chapter 4
(2) Regardless of whether or not the two groups produce parallel profiles, does one
group, on average, produce higher numbers of cells than the other, ignoring time?
This is called the levels hypothesis in the literature (Johnson & Wichern, 1982;
Tabachnick & Fidell, 1989). It addresses the same question as the between
subjects main effect, ‘group’, in repeated measures ANOVA.
(3) The third question addressed by profile analysis concerns the similarity of
response to all months, independent of groups. Does each month elicit the same
response? This question is relevant only if the profiles are parallel. If the profiles
are not parallel, then at least one of them is not flat. The flatness test evaluates
whether mean cell production changes over the period of testing. The flatness test
evaluates the same hypothesis as the within subjects main effect, ‘month’, in
repeated measures ANOVA.
As with the univariate approach, profile analysis has certain assumptions, all of
which are common to the various forms of multivariate analysis of variance.
28
The second assumption requires that the dependent variables, months in this case,
must have been subject to the same scaling metric. In situations where profile analysis
is used as an alternative to repeated measures designs this is automatically met since
the dependent variables, months, measure the same characteristic but at different
times.
As with the univariate approach, the results of profile analysis generalize only to the
populations from which the subjects are randomly sampled. Since the cows in this
study were randomly selected, this assumption is met.
Multivariate methods are extremely sensitive to outliers. Since this data set contains
numerous outliers, it is important that a test for multivariate normality be carried out.
Vonesh and Chinchilli (1997) recommend carrying out a test for multivariate
normality on the residuals rather than the original observations, while Johnson and
Wichern (1982) advise testing the dependent variables.
1 2
f ( x) = e −[( x − µ ) / σ ] /2
2πσ 2
Which leads to the joint density for a multivariate normal population with mean
vector µ and covariance matrix Σ. Assuming that the p × 1 vectors X1, X2, … XN
represent a random sample from a multivariate normal distribution, are mutually
independent, and each has a distribution Np(µ , Σ ).
The joint density for all the observations is the product of the marginal normal
densities. Therefore, the joint density of the vectors X1, X2, … XN is
N
1
∏ (2π )
−1
e −( xi − µ )'Σ ( xi − µ ) / 2
i =1
p/2
|Σ|
1/ 2
30
1 − ∑ ( x i − µ )'Σ −1 ( x i − µ ) / 2
= e i =1
(2π ) Np / 2 | Σ |N / 2
As previously mentioned, testing for multivariate normality can be carried out on the
original observations or the residuals. Johnson & Wichern (1982) test for multivariate
normality using the original observations, and the method they use will be applied to
the transformed (loge ) observations.
s p ,1 s p,2 s p , p
given by
1 N
S= ∑ (Xi − X)(Xi − X)'
N − 1 i =1
σ 1,1 σ 1, 2 σ 1, p
σ σ 2, 2 σ 2, p
Σ=
2,1
σ p ,1 σ p , 2 σ p , p
When the parent population is multivariate normal and both N and N - p are greater
than 25, each of the d2 should behave like a χ2 random variable. The values of d2 can
1 1 1
be plotted against χ p ((i − ) / N ) where χ p ((i − ) / N ) is the 100(i − ) / N
2 2
2 2 2
percentile of the χ2 distribution with p degrees of freedom. To construct the plot the
values of d2 should be ordered from smallest to largest as
1
d (21) ≤ d (22 ) ≤ d (23) ≤ ≤ d (2N ) . Next, the pairs (d (2i ) , χ 2p ((i − ) / N )) are plotted. The
2
chi-squared plot should resemble a straight line if the assumption of multivariate
normality holds. Another way of evaluating p-variate normality is if roughly half of
Another benefit of the chi-square plot is the ease of identification of outliers. The plot
does not show the presence of any outliers. This is important because multivariate
analysis is extremely sensitive to outliers. Figure 7 shows the chi-square plot for this
data set.
32
Figure 7.
20
ChiSq8 10
0
2 7 12 17
DsqSorted
Since the Figure 7 shows little deviation from linearity, the assumption of multivariate
normality is acceptable for the transformed data. The next assumption to be tested is
that of the equality of the variance-covariance matrices.
The MANOVA approach assumes that the observation vectors for each individual
arise from a multivariate normal distributions, and that the distributions for each
group have the same covariance matrix. The latter assumption is an extension of the
equal variance assumption in univariate ANOVA. The error rates of tests are less
affected if the assumption of equal covariance matrices is false when the sample sizes
are approximately equal. Departures from variance homogeneity have more serious
effects on the Type 1 error rate than departures from multivariate normality (Vonesh
& Chinchilli, 1997). Fortunately, a violation of variance homogeneity has minimal
impact if the groups are of approximately equal size (if the largest group divided by
the smallest group is less than 1.5 (Tabachnick & Fidell, 1989)). A procedure to test
for the equality of variance-covariance matrices is given in Hand and Crowder (1996).
It is less complicated than the more common Box’s M test, and will be used here.
33
H0 : Σ control = Σ treatment
H1 : Σ control ≠ Σ treatment
Let Sp be the unbiased estimator of Σ p, with Scontrol and Streatment estimating Σ control and Σ
, respectively. The likelihood ratio test statistic is
treatment
r r
M = ∑ (n j − 1) ln S p − ∑ (n j − 1) ln S j
j =1 j =1
r
2 p + 3p −1
2
1 1
k = 1− ∑
6( p + 1)(r − 1) j =1 ( n j − 1)
− r
∑ ( n j − 1)
j =1
where r = the number of groups in study, 2 in this case. For the data set in question,
the above calculations result in Mk = (70.192)(0.78) = 54.7. Since Mk is distributed
as χ 2 with 36 degrees of freedom, the p value of the test statistic = 0.03. This test is
extremely sensitive, and provided the sample sizes are not too discrepant, the
hypothesis of equal variance-covariance matrices should only be rejected at the 0.01
level of significance (Hand & Crowder, 1996). Therefore the null hypothesis is not
rejected in this case.
34
Since none of the assumptions appear to have been violated, the profile analysis can
proceed. Both Johnson and Wichern (1982) and Tabachnick and Fidell (1989)
recommend profile analysis as an alternative to repeated measures ANOVA.
The hypothesis tests in profile analysis are the same as those tested in the univariate
ANOVA carried out in Chapter 4, although the terminology is slightly different.
The first hypothesis test is called the test for parallelism in the profile analysis
literature, and as was mentioned earlier, is essentially a test for the interaction
between the groups and the repeated-measures factor. It tests whether the mean
responses along the levels of a repeated-measures factor (months in this case) are
similar for both groups. Parallelism exists when the interaction is not significant. The
mean cell production over time for both groups is shown in Figure 8.
Figure 8.
ln(CELLS) 7
4
2 3 4 5 6 7 8 9
MONTH
Control
− − − − − Treatment
35
Formally, the test for parallelism (interaction between time and group) can be written
as
against
Or alternatively,
H0 : Cµ1 = Cµ 2
H1 : Cµ1 ≠ Cµ 2
-1 1 0 0 0 0 0 0
0 -1 1 0 0 0 0 0
0 0 -1 1 0 0 0 0
C = 0 0 0 -1 1 0 0 0
0 0 0 0 -1 1 0 0
0 0 0 0 0 -1 1 0
0 0 0 0 0 0 -1 1
and µ 1 and µ 2 represent the p × 1 mean population vectors of cell production for the
control and treatment groups respectively.
36
−1
1 1
T = ( X1 − X 2 )' C' + CSC' C( X1 − X 2 ) > c 2
2
n1 n2
(n1 + n2 − 2)( p − 1)
where c =
2
F p −1, n1 + n2 − p (α )
n1 + n2 − p
1 N
covariance matrix Σ is estimated by S = ∑ (Xi − X)(Xi − X)'
N − 1 i =1
The transformed data has mean vectors X1 for the control group and X 2 for the
treatment group
5.373 5.633
6.127 6.088
5.803 6.048
1 n1 5.656 1 n2 5.974
X1 = ∑ Xi
n1 i =1
=
5.945
X2 = ∑ Xi
n2 i =1
=
6.028
5.978 6.087
6.342 6.129
6.373 6.118
37
then ( X1 - X 2 ) is
− 0.260
0.039
− 0.244
X1 − X 2 = − 0.317
− 0.082
− 0.108
0.212
0.255
For this data set, the calculated value of T2 = 10.098, while c2 = 19.27 with α = 0.05.
The p-value of T2 can be calculated, with some rearrangement of the above equation,
as p = 0.32. Given this result the null hypothesis cannot be rejected, i.e. mean changes
in cell production over time do not depend on group membership. This result is in
accord with the results of the interaction hypothesis tested in the univariate ANOVA.
The next hypothesis test in this profile analysis tests the same hypothesis as the
‘Groups’ test in the univariate ANOVA of Chapter 4. It tests whether the group means
differ when the levels of time are collapsed. The mean cell production, ignoring time,
for both groups is shown in Figure 9.
Figure 9.
y = .5 26 + .0 14× time
38
Thus the levels hypothesis asks whether the means of the two groups are the same,
ignoring times. Formally, the levels hypothesis is
This is similar to the univariate two-sample t-test. The hypothesis of equal group
means is rejected at the α level of significance if
2
1' ( X1 − X 2 )
T2 = > F1, n1 + n 2 − 2 (α )
1 1
+ 1' S pooled 1
n1 n2
For this data set, the value of T2 = 0.172, while the α = 0.05 level results in a value of
4.08 for the right-hand side of the equation and the p-value of this test statistic is 0.68.
Therefore the hypothesis of equal group means cannot be rejected, which is in
agreement with the univariate ANOVA test of group equality.
The final hypothesis tests the main effect for the repeated-measures factor time.
It is a test of whether the whole sample (ignoring group membership) is flat or has a
"profile" (i.e., shows reliable differences across the levels of the repeated-measures
factor – here time). This is analogous to the univariate ANOVA test of time effect in
Chapter 3, and in the multivariate literature it is known as the test of flatness. Johnson
and Wichern (1982) liken it to a multivariate generalisation of a one-sample t-test.
Figure 10 shows the mean ln(cell) counts for each month, ignoring group
membership. The plot shows that, in general, the mean ln(cell) count increases over
time.
39
Figure 10.
6.3
ln(CELLS)
6.2
6.1
6.0
5.9
5.8
5.7
5.6
5.5
2 3 4 5 6 7 8 9
MONTH
H0: µ 2 = µ3 = µ 4 = = µ p
H0 : Cµ = 0
H1 : Cµ ≠ 0
5.519
6.106
5.940
1 N 5.834
X = ∑ Xi =
N i =1 5.992
6.039
6.223
6.230
which leads to a test statistic of 32.68 and a critical value of 2.33. Since the
calculated value for the left-hand side of the above equation, 32.68, is larger than the
can be rejected at the α = 0.05 level of significance. The p-value of this hypothesis is
0.0000.
In summary, the profile analysis confirmed the results produced by the univariate
ANOVA in Chapter 4. While profile analysis is applicable in many experimental
situations, it has several limitations if an experimenter wants to analyse and fit growth
curves to the average growth of a population over time (Morrison, 1976). The
generalised multivariate analysis of variance is a simple extension of the multivariate
approach used in this chapter, and is the subject of the next chapter.
41
At first it might appear appropriate that linear regression could be used to model the
mean responses for the two groups. The problem, however, is that concerning the
assumptions of linear regression, i.e. the random variables are assumed to be
independent of one another. This is clearly not the case here, as cell counts on the
same cow taken at different times are highly correlated. For example, if the cell count
of a particularly healthy cow in the control sample was low at month 3 relative to the
population cell count at month 3, it would tend to be low at month 4. Thus the
observations on any given cow are not independent across time, so a model other than
the linear regression model may be more appropriate.
For the purposes of this study, the model proposed by Potthoff and Roy (1964) and
later by Kshirsagar and Smith (1995) will be used to find the growth curves for both
the control sample and the vaccinated sample. It can also be used to test if the growth
curves are equal for the two groups.
42
As was mentioned in the previous chapter, the GMANOVA can be used to circumvent
the problem of correlated observations. Stated briefly, the Generalised Multivariate
Analysis of Variance has the form
A
E(X) = B Θ
1 1 1 0 0 0 0
A=
0 0 0 1 1 1 1
Where the rows of A represent group membership, here control or treatment, and the
columns represent the N = 41 individual cows.
The model that is being developed can be described in more formal terms as follows:
where
The notation assumes that there are r different groups or treatments and a single
growth variable x is measured at p time points t1, t2, … tp on nj cows chosen at random
from the j-th group (j = 1, 2,…,r).
For the data being analysed in this thesis, the above notation translates into the
following
expected cell count at time t = E(xt) = θj0t0 + θj1t1
As in the general linear model case, the GMANOVA depends on certain assumptions
being met. These assumptions are the same as that of profile analysis. Since the
assumptions were safely met, there is no need to restate them here.
Since the characteristic being measured is the result of a biological process, a tentative
regression polynomial of
was chosen to represent the growth curves of the two groups. The regression plots in
the beginning of the thesis indicated that the relationship is close to linear. A better fit
may be obtained by choosing a quadratic term as well, but the plots do not indicate
substantial curvature. In the next section a goodness-of-fit test will be carried out to
ascertain the adequacy of the degree of polynomial.
44
The first step in obtaining the coefficients for the growth curves is to obtain the matrix
S, where S is given by
where X is the matrix of observations and A is the group indicator matrix outlined
earlier.
4350
. 17.44 1153
. 8.48 2.63 8.57 7.17 7.08
17.44 27.97 13.61 5.48 134. 9.42 4.81 4.67
1153
. 13.61 20.54 8.39 2.93 10.86 556
. 4.93
8.48 5.48 8.39 15.90 4.59 7.52 4.78 4.81
S=
2.63 134. 2.93 4.59 12.15 8.37 9.48 5.99
8.57 9.42 10.86 7.52 8.37 19.87 1141. 12.92
7.17 4.81 556
. 4.78 9.48 1141
. 1550
. 9.45
7.08 4.67 4.93 4.81 5.99 12.92 9.45 15.98
5.25771 5.80479
Θ̂ =
0.13554 0.04205
The first column of Θ̂ are the control group coefficients attached to t0 and t1, while
the second column contains the treatment group’s coefficients. This leads to the
equations y = 5.26 + 0.14 × time for the control and y = 5.80 + 0.04 × time for the
treatment group. Figure 11 shows the two regression lines, while figures 12 and 13
show the connected means and the regression lines superimposed.
45
Figure 11.
8
ln(CELLS)
4
2 3 4 5 6 7 8 9
MONTH
Control
− − − − − Treatment
Figure 12.
6.5
ln(CELLS)
6.0
5.5
2 3 4 5 6 7 8 9
MONTH
× and Control
+ and ∗ Treatment
46
Figure 13.
6
ln(CELLS)
2
2 3 4 5 6 7 8 9
MONTH
× and Control
+ and ∗ Treatment
While figures 12 and 13 show the same data, the vertical scale, loge(cells) has been
changed to illustrate the often deceptive nature of some plots. While Figure 12
provides ample detail, it gives the reader the impression that the differences between
the groups are quite large. Figure 13’s vertical scale has been resized to reflect the
amount of variability in the data. Recall from Figure 5 that the data were quite
variable, with values between 3 and 8 being plotted. When viewed in the context of
the amount of variability in the data, the differences between the two groups are not
as striking. Transforming the regression lines back to the original scale by applying a
transformation of ex to the slope-intercept parameters allows a visual comparison on
the original metric (see Figure 14).
47
Figure 14.
1000
CELLS
500
0
2 3 4 5 6 7 8 9
MONTH
Control
− − − − − Treatment
(2) Are the growth curves for the two groups equal?
The first hypothesis is important from a model building perspective. If the polynomial
regression that is fit to the growth curves is not adequate, i.e. the degree of polynomial
is too small, then the amount of unexplained error in the model may be too great.
Conversely, in the interests of parsimony, the degree of polynomial should not be too
great.
48
Many researchers (Graybill, 1976; Morrison, 1976) feel that a regression of linear,
quadratic or cubic degree on the time variable t is adequate for most growth curves
encountered in a practical setting. From looking at the graphs, a growth curve of
degree one was chosen to initiate the analysis.
D' B = 0
49
1 2
1 3
1 4
1 5
B=
1 6
1 7
1 8
1 9
where the first column corresponds to t0, the second, t1. Naturally, the rows of B are
the p time points, 8 in this study, at which the cell growth is measured at.
I p − B (B ' B ) −1 B '
where Ip is an 8 × 8 identity matrix. For this study the matrix D was found to be
−1
where the columns of D are the first six columns of the matrix I p − B (B ' B ) B ' .
E0
Λ0 =
E0 + H0
1690.51
Λ0 = = 0.6023
2806.56
To find the critical value for the hypothesis test the following are required
Since the error matrix is a square matrix of size 6 × 6, it has order 6. The degrees of
freedom for the error matrix are given in the table as N - r, which for this study results
in 41 - 2 = 39. The degrees of freedom associated with the hypothesis matrix are
given in the table as r, which in this study is equal to 2.
52
Therefore,
dm = 6 dE = 39 and dH = 2
Kshirsagar and Smith (1995) supply the general rule for rejecting a null hypothesis
based on Wilks’ Λ using a significance level of α.
1 − Λ ( d H + d E − d m − 1)
Λ
×
dm
( )
≥ F α ; 2d m , 2( d H + d E − d m − 1) .
Therefore, for the test of degree of polynomial with α = 0.01, the above equation
results in
1 − 0.6023
×
( 2 + 39 − 6 − 1) ≥ F ( 0.01;12,68)
0.6023 6
Since F(0.01; 12, 68) = 2.5 and the left hand side of the equation is equal to 1.635,
the null hypothesis cannot be rejected (p = 0.1038). As a result the polynomial of
degree 1 is an adequate model to represent the growth curves in this study.
cannot be rejected at the α = 0.01 level of significance, the next stage of the study will
test the second hypothesis, namely that of the equality of the growth curves for the
control group and the group receiving the vaccination.
53
Formally, the test of the equality of the growth curves for the control group and the
group receiving the vaccination is
H0: Θ 1 - Θ 2 = 0
H1: Θ 1 - Θ 2 ≠ 0
where Θ 1 is a 2 × 1 vector of coefficients for the control group’s growth curve and Θ 2
is a 2 × 1 vector of coefficients for the vaccination group’s growth curve. In this case,
ˆ ˆ
ˆ = θ 1,0
Θ ˆ = θ 2,0
Θ
θˆ1,1 θˆ2,1
1 2
To test the general linear hypothesis of the equality of growth curves, the hypothesis
test needs to put into a form
H0: LΘM = 0
H1: LΘM ≠ 0
1 0
L=
0 1
The rows of M correspond to the r groups in the study. Because there are two groups
in this study, M has the form
1
M=
− 1
where the columns of M represent the contrasts one wishes to compare. Therefore the
equation LΘM has the form
θˆ1,0 − θˆ2,0
ˆ
θ 1,1 − θˆ2,1
which is equivalent to the estimator of the matrix Θ 1 - Θ 2 as given earlier. The matrix
R needs to be derived using the equation
Carrying out the above equations produces the matrices R, E1, H1, and H1 + E1 as
follows
0.0839810 0.0086996
R=
0.0086996 0.0486768
23.7637 -2.9487
E1 =
-2.9487 0.5076
2.59674 -0.44373
H1 =
-0.44373 0.07583
26.3604 -3.3924
H 1 + E1 =
-3.3924 0.5834
E1
Λ1 =
E1 + H 1
3.36658
Λ1 = = 0.870
3.86979
Kshirsagar and Smith (1995) give the procedure for ascertaining the critical values to
test the above.
1 − Λ dH + d E − dm
× > F (α ; d m , d H + d E − d m )
Λ dm
Since dH, the degrees of freedom for the hypothesis matrix H0, is equal to 1, the above
critical value takes the form, for α = 0.05
1 − 0.87 1 + 33 − 2
× > F (0.05; 2, 32)
0.87 2
Since 2.39 < 3.33 the null hypothesis cannot be rejected, p = 0.11, and conclude that
the growth curve for the control group is not significantly different than that of the
treatment group. No analysis if complete without examining the residuals. The
GMANOVA on the transformed (loge) cell counts produced residuals which appeared
quite satisfactory. Figure 16 (a) shows the residuals plotted against the predicted
values. The residuals appear uniform over time, with only one outlier. Figure 15 (b) &
(c) show the normal distribution of the residuals.
Figure 15.
57
3 50
2
40
1
30
Frequency
0
RES
-1 20
-2
10
-3
0
-4
5.5 6.0 6.5 -4 -3 -2 -1 0 1 2 3
FITS RES
(a) (b)
Normal Probability Plot
.999
.99
.95
.80
Probability
.50
.20
.05
.01
.001
-3 -2 -1 0 1 2
RES
Average: -0.0386646 Anderson-Darling Normality Test
StDev: 0.744071 A-Squared: 0.525
N: 328 P-Value: 0.179
(c)
58
7. Conclusion
In this thesis several approaches to the analysis of repeated measures data have been
illustrated. First, the time-by-time ANOVA, a rather simple approach consisting of
conducting t-tests of control versus treatment at each month, was considered. In none
of the 8 months of the experiment did the mean cell production differ between the 2
groups. Although the time-by-time approach is not recommended for reasons given in
Chapter 3, it is valuable from a heuristic perspective.
The repeated measures ANOVA provided a more useful, albeit more complex, model
which allows for the fact that the 8 measurements on each cow are correlated.
Univariate models such as this have the advantage of being more powerful than
corresponding multivariate tests illustrated in Chapters 5 and 6 (Vonesh & Chinchilli,
1997). Unfortunately, the assumptions regarding the univariate tests require that the
correlations between the 8 measurements are all the same. This is often an unrealistic
assumption, as those months that are closer together tend to be more closely
correlated than those months which are further apart. An adjustment developed by
Greenhouse and Geisser (1959) can be made if the correlation matrix does not
conform to the equi-correlation structure. This adjustment is only necessary if the
effects being tested are significant. However, Geisser (1980) recommends using a
multivariate procedure if the number of subjects, N, exceeds the number of
measurements made per subject, p.
The table below summarises the p values produced by the univariate and multivariate
approaches
Given the results of both the univariate and multivariate models, the vaccine to reduce
the cell production in cows does not appear to be effective.
In conclusion, carrying out the profile analysis was easier and quicker than the
univariate ANOVA and the GMANOVA. Provided the main assumption of N > p
holds, profile analysis should be used in subsequent experiments of this kind.
60
References
Diggle, P.J., Liang, K.Y., and Zeger, S.L. 1994. Analysis of Longitudinal Data. New
York : Oxford University Press.
Graybill, F. A. 1976. Theory and Application of the Linear Model. North Sciute,
Mass. : Duxbury.
Greenhouse, S.W., and Geisser, S. 1959. On methods in the analysis of profile data.
Psychometrika, 24, 95-112.
Hand, D., and Crowder, M. 1996. Practical Longitudinal Data Analysis. London:
Chapman & Hall.
Ito, P.K. 1980. Robustness of ANOVA and MANOVA Test Procedures. In Handbook
of Statistics, Vol 1. Krishnaiah, P.R. (Ed.), 199-225. North-Holland, Amsterdam.
Johnson, R.A., and Wichern, D.W. 1982. Applied Multivariate Statistical Analysis.
Englewood Cliffs, NJ: Prentice-Hall.
Kshirsagar, A.M., and Smith, W.B. 1995. Growth Curves. New York: Marcel-Dekker.
Lindsey, J.K. 1993. Models for Repeated Measurements. New York: Oxford
University Press.
Milliken, G.A., and Johnson, D.E. 1984. Analysis of Messy Data, Vol 1. New York:
Van Nostrand Reinhold.
Potthoff, R.F., and Roy, S.N. 1964. A Generalized Multivariate Analysis of Variance
Model Useful Especially for Growth Curve Problems. Biometrika 51:313-326.
61
Tabachnick, B.G., and Fidell, L.S. 1989. Using Multivariate Statistics. New York,
NY: Harper-Collins.
Vonesh, E.F., and Chinchilli, V.M. 1997. Linear and Nonlinear Models for the
Analysis of Repeated Measurements. New York: Marcel Dekker.
62
Appendix A
Cow Month2 Month3 Month4 Month5 Month6 Month7 Month8 Month9 Group
0 = control
1 = treatment