mantel_test | R Documentation |
Performs a Mantel test between two correlation/distance matrices. The function calculates the correlation between two matrices, the Z-score that is is the sum of the products of the corresponding elements of the matrices and a two-tailed p-value (null hypothesis: \mjsdeqnr = 0).
mantel_test(mat1, mat2, nboot = 1000, plot = FALSE)
mat1, mat2 |
A correlation matrix or an object of class |
nboot |
The number of permutations to be used. Defaults to |
plot |
if |
mantel_r
The correlation between the two matrices.
z_score
The Z-score.
p-value
The quantile of the observed Z-score. in the permutation
distribution.
Tiago Olivoto tiagoolivoto@gmail.com
pairs_mantel()
library(metan) # Test if the correlation of traits (data_ge2 dataset) # changes between A1 and A2 levels of factor ENV A1 <- corr_coef(data_ge2 %>% subset(ENV == "A1"))[["cor"]] A2 <- corr_coef(data_ge2 %>% subset(ENV == "A2"))[["cor"]] mantel_test(A1, A2, plot = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.