Assesses the association between similarity matrices (J.W. McNicol, E.I. Duff & D.A. Elston).

### Options

`PRINT` = string token |
Controls printed output (`test` ); default `*` i.e. none |
---|---|

`METHOD` = string token |
The type of metric by which to compare the distance matrices (`correlation` , `rankcorrelation` , `mantel` ); default `corr` |

`NPERMUTATIONS` = scalar |
The number of permutations of the units in the second distance matrix `X` on which the significance of the correlation between `Y` and `X` is to be based; default 100 |

### Parameters

`Y` = symmetric matrices |
The first distance or similarity matrix: the order of the units of this matrix is held fixed |
---|---|

`X` = symmetric matrices |
The second distance or similarity matrix: the rows of `X` are permuted to allow the significance of the correlation between `Y` and `X` to be assessed |

`SEED` = scalars |
Random number seed for the permutations; default set by `RANDOMIZE` |

`M` = scalars |
Association between `Y` and `X` |

`MPERMUTED` = variates |
Associations between `Y` and the permuted `X` ‘s |

`CUPROB` = scalars |
The proportion of `MPERMUTED` values greater than or equal to `M` |

`YOFFDIAGONAL` = variates |
Variate to save the off-diagonal elements of the distance/similarity matrix `Y` |

`XOFFDIAGONAL` = variates |
Variate to save the off-diagonal elements of the distance/similarity matrix `X` |

### Description

The extent to which two similarity/distance matrices describe the same relationships among the units can be measured by comparing their off-diagonal elements. The metrics to be used can be selected using the `METHOD`

option: product-moment correlation (`correlation`

), rank correlation (`rankcorrelation`

) and `SUM(X*Y)`

(`Mantel`

). The last of these is the metric originally proposed by Mantel (1967). If the metric `rankcorrelation`

is selected, the data are restricted to non-missing units and Spearman’s rank correlation is used.

The significance of the association is assessed by a permutation test. The rows/columns of the second matrix are permuted at random and the association is recalculated for each permutation. Significance is estimated by the percentage of the permutations with association less/more than or equal to that of the original association.

If the number of random permutations, specified by the `NPERMUTATIONS`

option, is set to a number greater than or equal to the total number of distinct permutations *d*!, where *d* is the dimension of the symmetric matrices, the full randomization test is implemented. Otherwise the rows/columns of the second matrix are permuted at random without regard to the duplication of specific permutations. By default, 100 permutations are done. The `SEED`

parameter can supply a seed for the random numbers used to generate the random permutations. By default `SEED`

=0, so the random numbers will continue any existing sequence, used earlier in the Genstat program, or be initialised by the `RANDOMIZE`

directive.

The two matrices to be compared are specified by the `Y`

and `X`

parameters. The `M`

parameter allows the value of the statistic for the original matrices to be saved, the `MPERMUTED`

parameter saves the values from the permuted matrices, and the `CUPROB`

parameter saves the proportion of the permuted associations that are greater than the association between the original matrices. The off-diagonal elements of the matrices, on which the calculations are based, can be saved as variates using the `XOFFDIAGONAL`

and `YOFFDIAGONAL`

parameters.

The `PRINT`

option can be set to `test`

to print the values of `M`

and `CUPROB`

; by default there is no output.

Options: `PRINT`

, `METHOD`

, `NPERMUTATIONS`

.

Parameters: `Y`

, `X`

, `SEED`

, `M`

, `MPERMUTED`

, `CLPROB`

, `YOFFDIAGONAL`

, `XOFFDIAGONAL`

.

### Method

The off-diagonal elements of the symmetric matrices are transferred to variates by `EQUATE`

, and the association is derived by `CALCULATE`

for methods `correlation`

and `Mantel`

, and by `SPEARMAN`

for `rankcorr`

. If the full randomization test is used, all possible permutations of the rows of the second matrix are generated by `PERMUTE`

. Otherwise a random set of permutations is generated by permuting an index to the rows of the matrix using `RANDOMIZE`

. The permutations are then performed using `CALCULATE`

, with the permuted indices as a qualified identifier.

### References

Mantel, N. (1967). The detection of disease clustering and a generalized regression approach. *Cancer Research*, 27, 209-220.

Manly, B.F.J. (1991). *Randomization and Monte Carlo Methods in Biology*. Chapman & Hall, London.

### See also

Procedure: `ECANOSIM`

.

Commands for Multivariate and cluster analysis.

### Example

CAPTION 'MANTEL example',\ !t('Data are from Tables 1.1, 1.2 and 1.3 of Manly B.F.J.',\ '(1991) Randomization and Monte Carlo Methods in Biology.');\ STYLE=meta,plain SYMMETRIC [ROWS=8] Assoc,Dist1,Dist2 READ Assoc 1 .30 1 .14 .50 1 .23 .50 .54 1 .30 .40 .50 .61 1 -.04 .04 .11 .03 .15 1 .02 .09 .14 -.16 .11 .14 1 -.09 -.06 .05 -.16 .03 -.06 .36 1 : READ Dist1 0 1 0 2 1 0 1 2 3 0 2 3 4 1 0 3 4 5 2 1 0 2 3 4 3 4 5 0 1 2 3 2 3 4 1 0 : READ Dist2 0 1 0 2 1 0 1 1 1 0 2 1 1 1 0 3 2 2 2 1 0 2 1 2 2 2 3 0 1 2 3 2 3 4 1 0 : PRINT [SERIAL=yes] Assoc,Dist1,Dist2; FIELD=7; DECIMALS=2 MANTEL [PRINT=test; NPERMUTATIONS=25] Y=Assoc; X=Dist1; SEED=615023 MANTEL [PRINT=test; NPERMUTATIONS=25] Y=Assoc; X=Dist2; SEED=712378