p-valuemanova

Manova Strange P value


I worked on this for a day, and hope you guys can give a hint on this strange thing.

y0, y1, and y2 are independently generated by the same method.

They are each split into 20 groups by the same method.

Yet, manova says they are significantly different? Why?

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

Solution

  • I'm really not sure why, but I started running your code and the first three lines seem to shed some light as to why you are getting different results. If you run that part of the code and then simply ask

    y0
    y1
    y2
    

    you will see that all three objects have different elements. In fact, all elements are different. As to why this is so, I'm not sure cause your defining them the same way, but they are different for sure. Plot them out and take a look.

    Hope this helps