1
$\begingroup$

I am having difficulty finding a package or finding code for a permutation test to correlate two non-square matrices. Basically, trying to do a mantel test but for non-square matrices. Any help is greatly appreciated.

Edit for more explanation: These matrices represent distance measures between males and females. One distance matrix is genetic data, the other distance matrix is chemical data. I have 19 females and 41 males (19x41 matrix). I don't want to compare males against each other, and females against each other in this test. So, ultimately, I have two distance matrices that I am trying to get a correlation coefficient and p-value estimated from, for example, 100 000 permutations.

Solved: I deconstructed the matrices using the melt command in the package RESHAPE. Then used perm.cor.test in the package JMUOUTLIER, and chose 10 000 permutations.

$\endgroup$
  • 1
    $\begingroup$ Could you explain more specifically what you mean by "correlate ... non-square matrices"? In the Mantel test, the matrices are square because that's a convenient way to represent all possible distances among a set of objects. But what does the non-squareness mean? What do these matrices represent? $\endgroup$ – whuber Jun 13 '16 at 19:22
-1
$\begingroup$

Solved: I deconstructed the matrices using the melt command in the package RESHAPE. Then used perm.cor.test in the package JMUOUTLIER, and chose 10 000 permutations.

| cite | improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ It's difficult to see why this would be a valid test, because it destroys the inherent dependency structure in the original matrix. You may have gotten bogus results. $\endgroup$ – whuber Feb 22 at 22:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.