vegandevs / vegan

R package for community ecologists: popular ordination methods, ecological null models & diversity analysis
https://vegandevs.github.io/vegan/
GNU General Public License v2.0
436 stars 95 forks source link

Different results when inputting bray curtis distance matrix vs community data matrix with method = bray #597

Closed Rob-murphys closed 9 months ago

Rob-murphys commented 9 months ago

I am getting different 8but similar) results depending on if my input is a pre calculated bray curtis distance matrix or a feature table with method = "bray". Should that not give the same results and if not why not?

Result from community matrix with method = "bray"

> adonis_pairwise_16S.res$S_vs_LW
                     Df SumOfSqs      R2       F Pr(>F)    
caste_phase2          1   0.7220 0.02977  5.0394  1e-04 ***
species               6  14.3224 0.59056 16.6610  1e-04 ***
caste_phase2:species  6   3.0471 0.12564  3.5446  1e-04 ***
Residual             43   6.1607 0.25403                   
Total                56  24.2522 1.00000                   
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Result from pre calculated distance matrix:

> adonis_pairwise_16S.res$S_vs_LW
                     Df SumOfSqs      R2        F Pr(>F)    
caste_phase2          1 0.001621 0.01235  13.3694  1e-04 ***
species               6 0.120380 0.91719 165.4819  1e-04 ***
caste_phase2:species  6 0.004035 0.03074   5.5467  1e-04 ***
Residual             43 0.005213 0.03972                    
Total                56 0.131249 1.00000                    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
gavinsimpson commented 9 months ago

Nothing here indicates this is an issue with {vegan}; and the object names suggest that you are using a function not in {vegan} (adonis_pairwise() or some such). I suggest you follow up with the developers of the function you are using or provide a minimal working example to reproduce the problem if you think it is in {vegan}.

Rob-murphys commented 9 months ago

Wow I am tired. Legit posted on the wrong github repo...sorry!

gavinsimpson commented 9 months ago

Not a problem - been there; done that recently too