Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
different results from vegan depending on input type #147
i am trying to use the adonis function in vegan to run the permanova analysis. but i am getting very different results depending on how i call adonis.
if i call adonis using a distance object such as the following:
bc=vegdist( data, method='bray')
i get a very different result than if i convert bc (a dist object) into a matrix:
bc=as.matrix( vegdist(data, method='bray') )
what is causing this difference and which is correct?
You should supply either a distance object or data. If you supply a matrix, it is regarded as data and dissimilarities are calculated. So the following should be equivalent:
bc <- vegdist(data, method="bray") adonis(bc ~ var) adonis(data ~ var)
The second form you had would be equivalent to:
adonis(vegdist(as.matrix(vegdist(data))) ~ var)
which makes no sense. I suggest you follow the document and supply either a distance object or data.