Skip to content
Prev 8517 / 20628 Next

"mixed" MANOVAs

On Jun 29, 2012, at 19:08 , Andr?s Egea wrote:

            
Well, according to ?manova, 

    ?manova? does not support multistratum analysis of variance, so
     the formula should not include an ?Error? term.

There is no specific reason that it cannot work (for balanced error designs, but that's true for aov as well) other than the fact that noone has implemented it. (It's what some sarcastically call a SMOP -- Simple Matter of Programming...)

And true enough, if you try:
Warning message:
In aov(cbind(yield, foo) ~ N * P * K + Error(block), npk) :
  Error() model is singular

or:
Warning message:
In aov(cbind(yield, foo) ~ N * P * K + Error(block), npk) :
  Error() model is singular

(The two do basically the same thing, manova() does little more than adding an extra class to the result.)

The warning is a bit obscure; it probably just means that something inside aov() didn't expect a matrix response. 


HOWEVER, it turns out that aov has done all the right calculations!!! The result (in m) is composed of a list of objects of class "mlm", for which anova.mlm (which didn't exist at the time manova() was written) knows how do the right thing:
$block
Analysis of Variance Table

          Df  Pillai approx F num Df den Df Pr(>F)
N:P:K      1 0.38534  0.94038      2      3 0.4819
Residuals  4                                      

$Within
Analysis of Variance Table

          Df  Pillai approx F num Df den Df   Pr(>F)   
N          1 0.58359   7.7083      2     11 0.008079 **
P          1 0.04395   0.2528      2     11 0.781005   
K          1 0.44757   4.4560      2     11 0.038241 * 
N:P        1 0.21078   1.4689      2     11 0.272010   
N:K        1 0.15182   0.9845      2     11 0.404269   
P:K        1 0.30928   2.4627      2     11 0.130665   
Residuals 12                                           
---
Signif. codes:  0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 

And lo and behold:
Warning message:
In aov(cbind(yield, foo) ~ N * P * K + Error(block), npk) :
  Error() model is singular
Error: block
          Df  Pillai approx F num Df den Df Pr(>F)
N:P:K      1 0.38534  0.94038      2      3 0.4819
Residuals  4                                      

Error: Within
          Df  Pillai approx F num Df den Df   Pr(>F)   
N          1 0.58359   7.7083      2     11 0.008079 **
P          1 0.04395   0.2528      2     11 0.781005   
K          1 0.44757   4.4560      2     11 0.038241 * 
N:P        1 0.21078   1.4689      2     11 0.272010   
N:K        1 0.15182   0.9845      2     11 0.404269   
P:K        1 0.30928   2.4627      2     11 0.130665   
Residuals 12                                           
---
Signif. codes:  0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 


So it seems that things are pretty darn close to actually just working. 

One caveat: I am pretty sure that the above results are more than superficially sane, but I haven't actually checked. For good measure, if you have a textbook MANOVA example, perhaps you should try that first and see if you can reproduce its test statistics.

-pd