简体   繁体   中英

How to extract p value from Manova output

I am testing the Hotelling T^2 test via the manova formula in R. I am testing different same sizes and so have multiple Manova table output. Below is how I generated the manova for the entire sample

attach(iris)
library(Hotelling)
library(corpcor)
s= iris[1:100,1:5]
input= cbind(s$Sepal.Length,s$Sepal.Width, s$Petal.Length, s$Petal.Width )
m= manova(input~ Species, data = s)
summary(m, "Hotelling-Lawley")

I was wondering how I could extract the p value from each table. I tried to following but had no such luck:

res$"Pr(>F)"

res$p.value

summary(man)[8]

but each return NULL

In your example, p is very small:

summary(m, "Hotelling-Lawley")$stats

          Df Hotelling-Lawley approx F num Df den Df       Pr(>F)
Species    1         26.33509 625.4583      4     95 2.664857e-67
Residuals 98               NA       NA     NA     NA           NA

The p-value can be isolated for a given predictor, eg Species , like this:

summary(m, "Hotelling-Lawley")$stats["Species", "Pr(>F)"]
[1] 2.664857e-67

Docs here .

I know this is just a test case with iris , but even so: consider that when a p-value is this small, it begins to lose meaning as a valid test statistic. You might instead choose a measure of effect size, or even descriptive statistics, to support your results.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM