-
Hello everyone! I'm stuck at a problem with the betadisper function and have no idea how to move forward. I am using the betadisper() function to test for homogeneity of group dispersions (variances). As the data argument, I introduced a dissimilarity object I calculated using the daisy() function. The distances between observations are calculated using Gower's distance method. The reason I used this method in particular is because my data is composed mixed variables (continuous and categorical):
When I run this, I get this warning message:
I have checked if there are any negative values in the dissimilarity object by converting it to a matrix and then using the which() function and there are no negative values in it.
row col I don't know why am I getting this warning message. Further, if the betadisper function is converting values that are allegedly negative to zero, this would mean I would be losing information in terms of differences between observations. I would appreciate any help you could provide me for this. Thank you! Daniel |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
The warning should be clearer, but it isn't talking about the input dissimilarities. What it is referring to are the distances of samples to their group centroid, which for non-metric dissimilarities get split into a component associated with the positive eigenvalues of the principal coordinates analysis used internally, and a component associated with the negative eigenvalues. If the distance to centroid in this negative-eigenvalue space is larger than the distance to centroid in the positive-eigenvalue space, we reset these negative distances-to-centroids to be equal to zero. It might help to use some of the options that avoid negative eigenvalues in principal coordinates analysis if the above description of the warning still worries you. |
Beta Was this translation helpful? Give feedback.
Here an expanded explanation of the nature negative eigenvalues and low down dirty tricks to avoid the nuisance of negative eigenvalues. The panels below were produced with
vegan::stressplot()
function ofvegan::dbrda(d ~ 1)
model, whered
were the Bray-Curtis dissimilarities of the Dune meadow data (dune
). The horizontal axis displays the input dissimilarities, and the vertical axis the dissimilarities as calculated from the full real solution of the analysis. In terms ofbetadisper
, horizontal axis shows the input dissimilarities, and the vertical axis the dissimilarities as the real distances appear internally inbetadisper
.With metric distances (Euclidean, Hellinger etc.) all points …