Hy4m / linkET

Everything is Linkable
135 stars 38 forks source link

what methods to calculate the correlation (r) and p.value in Mantel_test() #24

Open xiaojjia opened 4 months ago

xiaojjia commented 4 months ago

Thanks for your great package!

When I perform a _mantel_test_ analysis using the default parameters (mantel_fun = "mantel"), I am a little confused as to how the correlation r-values ​​and p-values ​​are calculated. After checking the source code, I guessed that the Pearson was used. If so, I would like to know if other methods can be used to calculate the correlation, such as Spearman.

PS: I also tried adding "method='spearman'" to the _manteltest function, but the step ran for more than 2 hours with no results. On the contrary, without adding this parameter, it only took half an hour to complete.

Thanks in advance for your help!

Best! xiaojjia

Hy4m commented 1 month ago

Yes, you can set method = "spearman" in mantel_test() function. I suggest setting mantel_fun argument to "mantel.randtest", and it's faster than "mantel".