## Mantel's permutation test for similarity of two matrices
## 1. Permutes the rows and columns of the two matrices randomly
## 2. Calculates a Z-statistic =
## sum of the pairwise product of the lower triangles
## of the permuted matrices, for each permutation of rows and columns
## 3. Compares the permuted distribution with the Z-statistic observed
library(ape)
mantel.test(mat1,mat2)
## If only 1 variable :
## calculates the simple Mantel r
## If more than 1 variable :
## calculates partial Mantel r by permuting one of the original dissimilarity matrices
library(ecodist)
mantel(mat2 ~ mat1)
## Matrix correlation between two dissimilarity matrices
## Partial matrix correlation between three dissimilarity matrices
## (significance through permutation of the first matrix)
library(vegan)
mantel(mat1,mat2)
mantel.partial(mat1,mat2,mat3)
Modification du \(R^2\) de Cox & Snell pour obtenir une valeur théorique plus proche de 1.
fmsb
, function NagelkerkeR2
:\[\begin{align} R^2_{fmsb} &=& \frac{1 - e^{\frac{dev - null}{n}}}{1 - e^{\frac{- null}{n}}} \end{align}\]
\[\begin{align} R^2_{normal} &=& 1 - \left[ \frac{e^{\frac{- null}{2}}}{e^{\frac{- dev}{2}}} \right]^{2/n} \\ \\ R^2_{rescaled} &=& \frac{R^2_{normal}}{1 - \left( e^{\frac{- null}{n}} \right)^{2/n}} \\ \\ R^2_{adjusted} &=& 1 - \left( \frac{n-1}{n-p} \right)\cdot(1 - R^2_{normal}) \\ \\ R^2_{adjusted\text{, }rescaled} &=& 1 - \left( \frac{n-1}{n-p} \right)\cdot(1 - R^2_{rescaled}) \end{align}\]
with :
Hmisc
, function somers2
:\[\begin{align} AUC_{Hmisc} &=& \frac{\overline{\text{rank }_1} - \frac{n_1 + 1}{2}}{n - n_1} \end{align}\]
PresenceAbsence
, function AUC
:\[\begin{align} AUC_{PresenceAbsence} &=& \frac{n_0 \cdot n_1 + n_0 \cdot \frac{n_0 + 1}{2} - \Sigma \text{ rank }_0}{n_0 \cdot n_1} \end{align}\]
with :
Presence-only data. Spearman correlation
\[\begin{align} VIF_i &=& \frac{1}{1 - R^2_i} \end{align}\]
Ranges from 1 upwards :
RLeca generalization :
\[\begin{equation} V_{n} = \Sigma_{j = 1, 3, ...}^n \left( \Sigma_{c = C_{n}^j} V_{(c)} \right) - \Sigma_{k = 2, 4, ...}^n \left( \Sigma_{d = C_{n}^k} V_{(d)} \right) \end{equation}\]
\[\begin{equation} V_{C_{n}^i, n} = V_{C_{n}^i, n-1} - V_{C_{n}^{i+1}, n} \end{equation}\]
with :