Skip to content

Extracting Numbers from MANOVA output

2 messages · Ko-Kang Kevin Wang, Marc Schwartz

#
Hi,

Suppose I have:
Df Pillai approx F num Df den Df    Pr(>F)    
plankton.new[, 1]  1 0.5267   9.8316      6     53 2.849e-07 ***
Residuals         58                                            
---
Signif. codes:  0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 

My understanding is the MANOVA summary returns a list.  However I am not 
sure how to extract out only part of the list.  For example is I want to 
extract the Pillai's test statistic, 0.5267, how can I do this?
#
On Sat, 2003-06-07 at 18:43, Ko-Kang Kevin Wang wrote:
Kevin,

To use the example from ?summary.manova, since I don't have your data:

## Example on producing plastic film from Krzanowski (1998, p. 381)
6.7, 6.6, 7.2, 7.1, 6.8, 7.1, 7.0, 7.2, 7.5, 7.6)
9.1, 9.3, 8.3, 8.4, 8.5, 9.2, 8.8, 9.7, 10.1, 9.2)
2.8, 4.1, 3.8, 1.6, 3.4, 8.4, 5.2, 6.9, 2.7, 1.9)
Df Pillai approx F num Df den Df   Pr(>F)
rate           1 0.6181   7.5543      3     14 0.003034 **
additive       1 0.4770   4.2556      3     14 0.024745 *
rate:additive  1 0.2229   1.3385      3     14 0.301782
Residuals     16
---
Signif. codes:  0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1


If you then use:
You will note at the bottom, the following:

...
 $ stats      : num [1:4, 1:6]  1.000  1.000  1.000 16.000  0.618 ...
  ..- attr(*, "dimnames")=List of 2
  .. ..$ : chr [1:4] "rate" "additive" "rate:additive" "Residuals"
  .. ..$ : chr [1:6] "Df" "Pillai" "approx F" "num Df" ...
 - attr(*, "class")= chr "summary.manova"


In this case 'stats' is a 4 by 6 matrix with defined dimnames. Thus to
get the individual statistics (ie. "Pillai"), use:
rate      additive rate:additive     Residuals
    0.6181416     0.4769651     0.2228942            NA


The use of str(object) will provide you with the internal structure of
the object, which in turn will enable you to extract specific values.


HTH,

Marc Schwartz