Re: [R] contrast matrix for aov

From: Prof Brian Ripley <>
Date: Thu 10 Mar 2005 - 21:38:20 EST

On Thu, 10 Mar 2005, Peter Dalgaard wrote:

> Prof Brian Ripley <> writes:
>> On Wed, 9 Mar 2005, Darren Weber wrote:
>>> How do we specify a contrast interaction matrix for an ANOVA model?
>>> We have a two-factor, repeated measures design, with
>> Where does `repeated measures' come into this? You appear to have
>> repeated a 2x2 experiment in each of 8 blocks (subjects). Such a
>> design is usually analysed with fixed effects. (Perhaps you averaged
>> over repeats in the first few lines of your code?)
> Actually, that's not "usual" in SAS (and not SPSS either, I believe)
> in things like
> proc glm;
> model y1-y4= ;
> repeated row 2 col 2;
> [Not that SAS/SPSS is the Gospel, but they do tend to set the
> terminology in these matters.]

That seems to be appropriate only if the four treatments are done in a particular order (`repeated') and one expects correlations in the responses. However, here the measurements seem to have been averages of replications.

It may be "usual" to (mis?)specify experiments in SAS that way: I don't know what end users do, but it is not the only way possible in SAS.

> There you'd get the analysis split up as analyses of three contrasts
> corresponding to the main effects and interaction, c(-1,-1,1,1),
> c(-1,1,-1,1), and c(-1,1,1,-1) in the 2x2 case (up to scale and sign).
> In the 2x2 case, this corresponds exactly to the 4-stratum model
> row*col + Error(block/(row*col)).
> (It is interesting to note that it is still not the optimal analysis
> for arbitrary covariance patterns because dependence between contrasts
> is not utilized - it is basically assumed to be absent.)

It also assumes that there is a difference between variances of the contrasts, that is there is either correlation between results or a difference in variances under different treatments. Nothing in the description led me to expect either of those, but I was asking why it was specified that way. (If the variance does differ with the mean then there are probably more appropriate analyses.)

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Thu Mar 10 21:47:55 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:42 EST