[R] Manova: Data similarly generated are significantly different.
Roger Xu
rxu823 at gmail.com
Fri Sep 4 23:18:22 CEST 2015
Dear R users,
Hi. I don't know if my understanding of Manova test is correct. So I test
with the following code and got strange results.
Any help would be appreciated.
y0, y1, and y2 are independently generated by the same method.
They are each split into 20 groups by the same method.
The summary of the Manova test (stored in variable s) says:
The Pr (>F) value is less than 2.2e-16.
y0 <- runif(100, 0, 1)
y1 <- runif(100, 0, 1)
y2 <- runif(100, 0, 1)
y0 <- c(y0, runif(100, 0, 10) )
y1 <- c(y1, runif(100, 0, 10) )
y2 <- c(y2, runif(100, 0, 10) )
y0=as.numeric(unlist(y0))
y1=as.numeric(unlist(y1))
y2=as.numeric(unlist(y2))
b=10
a=length(y0)/b
g=rep(1:a,rep(b,a))
m1 <- manova(cbind(y0, y1, y2) ~ g)
s=summary(m1, test = "Wilks")
a = s$stats
a = a[11]
s
a
The summary is here:
Df Wilks approx F num Df den Df Pr(>F)
g 1 0.37069 110.91 3 196 < 2.2e-16 ***
Residuals 198
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[[alternative HTML version deleted]]
More information about the R-help
mailing list