Re: [R] extracting elements from print object of Manova()

From: Jorge Ivan Velez <jorgeivanvelez_at_gmail.com>
Date: Tue, 15 Jul 2008 14:43:32 -0400

Dear Michael,

Does it work for you?

tear <- c(6.5, 6.2, 5.8, 6.5, 6.5, 6.9, 7.2, 6.9, 6.1, 6.3,

          6.7, 6.6, 7.2, 7.1, 6.8, 7.1, 7.0, 7.2, 7.5, 7.6) gloss <- c(9.5, 9.9, 9.6, 9.6, 9.2, 9.1, 10.0, 9.9, 9.5, 9.4,

           9.1, 9.3, 8.3, 8.4, 8.5, 9.2, 8.8, 9.7, 10.1, 9.2) opacity <- c(4.4, 6.4, 3.0, 4.1, 0.8, 5.7, 2.0, 3.9, 1.9, 5.7,

             2.8, 4.1, 3.8, 1.6, 3.4, 8.4, 5.2, 6.9, 2.7, 1.9) Y <- cbind(tear, gloss, opacity)
rate <- factor(gl(2,10), labels=c("Low", "High")) additive <- factor(gl(2, 5, length=20), labels=c("Low", "High"))

# The model
fit <- manova(Y ~ rate * additive)
fit
Call:

   manova(Y ~ rate * additive)

Terms:

                   rate additive rate:additive Residuals
resp 1           1.7405   0.7605        0.0005    1.7640
resp 2           1.3005   0.6125        0.5445    2.6280
resp 3           0.4205   4.9005        3.9605   64.9240
Deg. of Freedom       1        1             1        16

Residual standard error: 0.3320392 0.4052777 2.014386 Estimated effects may be unbalanced

# Analysis of Variance (table), names and F statistic anova(fit)
Analysis of Variance Table

              Df Pillai approx F num Df den Df    Pr(>F)
(Intercept)    1    1.0   5950.9      3     14 < 2.2e-16 ***
rate           1    0.6      7.6      3     14  0.003034 **
additive       1    0.5      4.3      3     14  0.024745 *
rate:additive  1    0.2      1.3      3     14  0.301782
Residuals     16
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1


names(anova(fit))
[1] "Df"       "Pillai"   "approx F" "num Df"   "den Df"   "Pr(>F)"

anova(fit)["approx F"]
approx F
(Intercept)     5950.9
rate               7.6
additive           4.3
rate:additive      1.3
Residuals


See ?summary.manova for more information.

HTH,

Jorge



On Tue, Jul 15, 2008 at 11:09 AM, Michael Rennie <mdrennie_at_gmail.com> wrote:


> Hi there,
>
> Does anyone know how to extract elements from the table returned by
> Manova()?
>
> Using the univariate equivalent, Anova(), it's easy:
>
> a.an<-Anova(lm(y~x1*x2))
>
> a.an$F
>
> This will return a vector of the F-values in order of the terms of the
> model.
>
> However, a similar application using Manova():
>
> m.an<-Manova(lm(Y~x1~x2))
>
> m.an$F
>
> Returns NULL. So does any attempt at calling the headers in the MANOVA
> table.
>
> Any thoughts?
>
> Mike
> --
> --
> Michael D. Rennie
> Ph.D. Candidate
> University of Toronto at Mississauga
> 3359 Missisagua Rd. N.
> Mississauga, ON L5L 1C6
> Ph: 905-828-5452 Fax: 905-828-3792
> www.utm.utoronto.ca/~w3rennie <http://www.utm.utoronto.ca/%7Ew3rennie>
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
[[alternative HTML version deleted]] ______________________________________________ R-help_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Received on Tue 15 Jul 2008 - 18:56:39 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 15 Jul 2008 - 19:31:59 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive