I am working with vegetation surveys that were conducted in several river networks. See the attached image that shows one of the those river basins/networks. I am interested in analyzing how the number of species in common between sample sites changes as function of distance (both network distance and euclidean distance).

enter image description here

I calculated 1) the number of species in common between all pairs of points and 2) network/euclidian distances between pairs of points. I am using Bayesian statistics and the software STAN to analyze this relationship. As an interface for STAN I am using the "rethinking" package from Richard McElreath's book "Statistical Rethinking".

The code below fits a linear multilevel model with varying intercepts and slopes for each river basin/network:

      Rho ~ dlkjcorr(2),

The code works but I am not sure the model is correct. I calculated metrics for each pair of points, which means the same point shows up in several pairwise comparisons. Does this create some kind of lack of independence that has to be taken into account in the model? If so, how should I include it?



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.