[R] aov and missing values

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Nov 3 15:31:36 CET 2000


> Date: Fri, 03 Nov 2000 16:10:54 +0200
> From: "Pedro J. Aphalo" <pedro.aphalo at joensuu.fi>
> 
> I am learning R, and although I have looked in the documentation, I may
> be asking something obvious. Sorry, if that is the case. 

(No, the problem is with your expectations from the theory.)

> In a split-plot design if there is a missing subunit summary gives me a
> table with two rows for the same factor, one in the error within section
> and one in the section using error between units. With no data missing
> the table is "normal". How does one interpret the table when data is
> missing?, or is it that aov cannot cope with missing values in this
> case?

aov() does cope, but the conventional analysis is indeed as you
describe.  Factors do have effects in more than one stratum. For example,
consider the oats example in Venables & Ripley (1999). If I omit
observation 70, I get

> summary(oats.aov)
Error: B 
          Df Sum of Sq  Mean Sq   F Value     Pr(F) 
Nf         1    841.89  841.890 0.2242563 0.6605042
Residuals  4  15016.57 3754.142                    

Error: V %in% B 
          Df Sum of Sq  Mean Sq  F Value     Pr(F) 
Nf         1  1100.458 1100.458 1.747539 0.2187982
V          2  1156.821  578.410 0.918521 0.4335036
Residuals  9  5667.471  629.719                   

Error: Within 
          Df Sum of Sq  Mean Sq  F Value     Pr(F) 
Nf         3  19921.29 6640.431 37.23252 0.0000000
Nf:V       6    408.96   68.160  0.38217 0.8864622
Residuals 44   7847.41  178.350                   

so Nf appears in all three strata, not just the last one.
The `recovery of intra-block information is needed'.

If you have an unbalanced layout (e.g. with a missing value) use
lme to fit a model.  V&R do this example in lme too.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list