Displaying 1 result from an estimated 1 matches for "mcrepl".
Did you mean:
mcepl
2012 Apr 10
1
compare two matrices
...and I want to compare them.
In fact I want to check the hypothesis if they come from the same process.
I tried to look for some test but all I found was independence test of
contingency tables.
The following code shows that the usual chi-squared test statistic does
not follow chisq distribution.
MCRepl <- 5000
khi12 <- rep(0,MCRepl)
for (i in 1:MCRepl){
n <- 10000
M1 <- matrix(table(sample(1:9, size = n, replace = TRUE)),3,3)
M1 <- M1/rowSums(M1)
M2 <- matrix(table(sample(1:9, size = n, replace = TRUE)),3,3)
M2 <- M2/rowSums(M2)
khi12[i] <- sum((M1-M2)...