[R] Repeated measures MANOVA

Bela Bauer bela_b at gmx.net
Fri Feb 25 13:27:26 CET 2005


Hi,

sorry to bother you again, but I can't figure it out myself and I also 
can't find any in-depth documentation about it...

Consider the following SAS code (A1II2... contain the measurements for 
40 subjects):

proc glm;
model
A1II2
A1IN2
A1NI2
A1NN2
= /nouni;
repeated CONTEXT 2, TARGET_SATZ 2;
title "A1 500-900 ms";

This produces not only the univariate ANOVAs, but also a number of 
multivariate MANOVAs, including some test statistics (Wilks' Lambda, 
Pillai's Trace, etc.) on various hypothesis (no CONTEXT effect, no 
TARGET_SATZ effect, no CONTEXT*TARGET_SATZ effect).

Unfortunately, I can't seem to be able to figure out how to reproduce 
this in R. There's obviously little sense in treating A1II2..A1NN2 as 
separate responses, so I came up with the following (for testing a 
single effect):

resp <- cbind(
		c(A1II2,A1IN2),
		c(A1NI2,A1NN2))
cond <- gl(2,40,80)
subj <- gl(40,1,80)

summary(manova( resp ~ cond + Error(subj/cond) ))

Error: subj
           Df Pillai approx F num Df den Df Pr(>F)
Residuals 39

Error: subj:cond
           Df  Pillai approx F num Df den Df Pr(>F)
cond       1 0.07911  1.63232      2     38 0.2089
Residuals 39
Warning message:
Error model is singular in: aov(resp ~ cond + Error(subj/cond))

Now, this looks halfway reasonable, but it's not quite there. My 
questions are:
- why is the Error model singular?
- am I even on the right path, or is this completely wrong?
- what do I do for interaction effects?

I'd be very happy if you could give me any hints of where I should be 
going with this...

Thanks again

Bela




More information about the R-help mailing list