An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-ecology/attachments/20100402/06b46152/attachment.pl>
How to calculate a community similarity index not supported by vegan
2 messages · Qi Li, Jari Oksanen
1 day later
On 2/04/10 07:18 AM, "Qi Li" <ericqili at hotmail.com> wrote:
Hi, I have to calculate similarity in community composition(in a community matrix) as the probability of randomly drawing two individuals of the same species at each pair of sampling points. The details as follows: For two plots, the probability F can be calculated as F =sum (fi1*fi2), where fij is the relative abundance of species i at site j, and the sum is over all species at both sites. I did not find any functions in library vegan and ecodist to calculate this index. Can anyone help on this?
Dear Qi Li, I am not quite sure I understand correctly what you want to achieve, but it looks to me like you want to have a crossproduct of a matrix standardized to unit row sums. With more words: (1) you want to standardize your data so that your rows have unit sum so that species are expressed as relative abundances, and (2) then you want to have a sum of products of these relativized values for each pair of sites. There are many ways of doing this (if this was what you wanted to do). In vegan you can use decostand() for the first task, and designdist() for the second: designdist(decostand(dune, "tot"), "J", terms="quadratic") This will give similarities, but vegan and all standard R functions expect dissimilarities. So you may consider asking for probabilities of randomly drawing individuals of *different* species, or designdist(decostand(dune, "tot"), "1-J", "quadratic") There are many other ways of doing this, though, as method = "J" with terms = "quadratic" in designdist() is just a crossproduct (or tcrossprod()). I am not sure if this was what you wanted to have, but you can see if you can define your method with designdist() which allows you design your sweet own dissimilarity indices. Cheers, Jari Oksanen