s-news
[Top] [All Lists]

repeated measure ANOVA with NAs

To: Snews <s-news@wubios.wustl.edu>
Subject: repeated measure ANOVA with NAs
From: Olivier.Renaud@pse.unige.ch
Date: Mon, 19 Nov 2001 17:07:12 +0100
Hi,
Dealing with a repeated measure ANOVA with NAs, I am a bit surprised by S+ 
output (S+6 as well as S+2000 on Win98). Example:

## anova with repeated measure. Works fine
> summary (aov(formula = mctend ~ Time + Error(Sujet/Time), data = c3))
Error: Sujet 
          Df Sum of Sq   Mean Sq F Value Pr(F) 
Residuals 39  37.72124 0.9672114              

Error: Time %in% Sujet 
          Df Sum of Sq  Mean Sq   F Value     Pr(F) 
     Time  2   0.81571 0.407857 0.3797048 0.6853207
Residuals 78  83.78317 1.074143                    

## Adding an NA
> c3$mctend[45] <- NA
## without specification for the treatment of the NA, the procedure stop. Fine
> summary (aov(formula = mctend ~ Time + Error(Sujet/Time), data = c3))
Error in function(object, ...): missing values not allowed: found in mctend

## But when we exclude the NA, the error is divided in 3 parts (including an 
na.action!), and the factor Time is tested twice !!
> summary (aov(formula = mctend ~ Time + Error(Sujet/Time), data = c3, 
> na.action=na.exclude))
Error: Sujet 
          Df Sum of Sq   Mean Sq   F Value     Pr(F) 
     Time  1   0.59182 0.5918184 0.6126098 0.4386575
Residuals 38  36.71031 0.9660609                    

Error: Time %in% Sujet 
          Df Sum of Sq  Mean Sq   F Value     Pr(F) 
     Time  2   0.80665 0.403327 0.3706737 0.6914941
Residuals 77  83.78298 1.088091                    

Error: na.action 
 Min. 1st Qu. Median Mean 3rd Qu. Max. 
   45      45     45   45      45   45

Is this a bug or my misunderstanding of repeated measure? In the first case, is 
it possible to compute separately the covariance matrix with an EM-algorithm 
for the missing values and to feed aov with it? Any other solution is also 
welcomed.

Olivier
-- 
----------------------------------------------------------------------
Olivier Renaud                      mailto:Olivier.Renaud@pse.unige.ch
Faculty of Psychology and Education               Tel: +41 22 705 9104
University of Geneva   -   40, Bd du Pont d'Arve  -   CH-1211 Geneva 4
                       http://www.unige.ch/fapse/PSY/persons/prof-ana/

<Prev in Thread] Current Thread [Next in Thread>