## Matrix Correlations

### Matrix Correlations

• Mantel Test generalized regression technique that examines associations of inter-individual distances based on one characteristic with those calculated from a second characteristic. This is a distribution-free (non-parametric) test. Moreover, one of these matrices can be artificially constructed to reflect a particular hypothesis (see below right)
• R-statistic: comparable to Spearman's Rho statistic for matrices. It is a Mantel's test performed on within-matrix ranks instead of the original variables. Ranks are averaged in case of ties.
• Kendall's Tau: sum of the number of cells in which the values change in the same direction, minus the number of cells in which they change in opposite directions. Kc = S |(Xij-Xik)(Yij-Yik)|

#### Uses

• measure the correlation between two proximity (or distance) matrices
• assess the degree of association between a distance matrix and a matrix representing a particular hypothesis

### How this is done

 A B C A B C A 125 4 A 1 0 B 23 29 B 1 1 C 12 201 C 0 1
• calculate sample Z as the sum of products for corresponding elements in the two distance matrices. Zs = ΣΣxijyij For a complete example use the following worksheet.
• create a probability density function with random permutations of rows and columns for the second matrix and calculate a Z value for each permutation
• test significance using t-Value with infinte df: t = (Zs - Mean(Zp)) / SD(Zp)
• you can even encode a particular hypothesis as a matrix. Consider the following example and devise a way to test for an association between the matrix based on your dependent measures and the one based on your hypothesis. You have obtained frequencies on how often each individual has grabbed another individual's lunch money. In this matrix all individual's are ranked based on body size where A > B > C > D > E.
 A B C D E A 49 65 33 12 B 1 93 12 40 C 4 0 23 12 D 2 3 0 8 E 0 0 4 5

Obtain a matrix that encapsulates the following hypotheses:

• a. Bullies indiscriminantly grab lunch money from anyone smaller than they are.

 A B C D E A B C D E

• b. To assert their bully position individuals grab lunch money mostly from the next smaller individual.

 A B C D E A B C D E

• c. Each individual bullies only the weakest individual of the group.

•  A B C D E A B C D E

 To perform a Mantel's Matrix correlation in R you can use library ade4. You pecify two distance matrices and the number of permutations you want performed > install.packages("ade4") > library(ade4) > mantel.rtest(station.dists, ozone.dists, nrepet = 9999)