[R] Manova: Data similarly generated are significantly different.

Duncan Murdoch murdoch.duncan at gmail.com
Sat Sep 5 02:04:30 CEST 2015


On 04/09/2015 5:18 PM, Roger Xu wrote:
> 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

If you plot any of the y columns vs g you see a huge effect.  You aren't
testing whether the y's are equal, you are testing whether the triplets
depend on g, and they do.

Duncan Murdoch



More information about the R-help mailing list