sp.pair(matr)V Value indicating species association is positive or negativea, b, c, d that corresponding to the co-occurrence could be used to conduct the species association analysis between the two species.
a = number of plots both occupied by speciesA and speciesB.
b = number of plots only found speciesA.
c = number of plots only found speciesB.
d = number of plots without speciesA or speciesB.
N = a+b+c+d
This function are using the following formula:
Chi square (Yate's correction):
chi^{2}=((((a*d-b*c)-0.5*N)^2)*N)/(a+b)*(a+c)*(b+d)*(c+d)
V ratio:
V = ((a+b)-(b-c))/(a + b + c + d)
Jaccard index:
Jaccard =a/(a + b + c)
Ochiai index:
Ochiai = a/sqrt((a+b)*(a+c))
Dice index:
Dice = 2*a/(2*a + b + c)
The Association Coefficient(AC):
if a*d>= b*c:
AC = (a*d - b*c)/((a+b)*(b+d))
if b*c>= a*d and d>=a:
AC=(a*d - b*c)/((a+b)*(a+c))
if b*c>a*d and a:
AC = (a*d - b*c/((b+d)(d+c))
Point correlation coefficient
(PCC):
PCC = {a*d-b*c}/{(a+b)*(a+c)*(c+d)*(b+d)}sp.assoc for species association for total species.data(testdata)
spmatrix <- data2mat(testdata)
result <- sp.pair(spmatrix)Run the code above in your browser using DataLab