Min and Max values of beta diversity (BD) estimated by the variance of Hellinger-transformed data. The total variance is computed on the table of raw data and from a D matrix. library(vegan) ======== Hellinger distance # Minimum BD when the sites have exactly the same species composition mat.sp1 = matrix(c(1,1,1,1,1,2,2,2,2,2,3,3,3,3,3),5,3) n1 = nrow(mat.sp1) mat.sp1.hel = decostand(mat.sp1, "hel") BD1 = sum( apply(mat.sp1.hel,2,var) ) BD1 [1] 0 # Another way to compute the total variance in the matrix # See Numerical ecology (1998), p. 329, eq. 8.5 ad 8.6 mat.sp1.D = dist(mat.sp1.hel) BD1 = sum(mat.sp1.D^2)/(n1*(n1-1)) BD1 [1] 0 -------- # Maximum BD when the sites have totally different species compositions mat.sp2 = matrix(c(1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1),3,6) n2 = nrow(mat.sp2) mat.sp2.hel = decostand(mat.sp2, "hel") BD2 = sum( apply(mat.sp2.hel,2,var) ) BD2 [1] 1 mat.sp2.D = dist(mat.sp2.hel) BD2 = sum(mat.sp2.D^2) / (n2*(n2-1)) BD2 [1] 1 --- # Another example mat.sp3 = matrix(c(1,0,0,2,0,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,10,0,0,100),3,8) n3 = nrow(mat.sp3) mat.sp3.hel = decostand(mat.sp3, "hel") BD3 = sum( apply(mat.sp3.hel,2,var) ) BD3 [1] 1 mat.sp3.D = dist(mat.sp3.hel) BD3 = sum(mat.sp3.D^2) / (n3*(n3-1)) BD3 [1] 1 ======== Chord distance # Chord transformation mat.sp3 = matrix(c(1,0,0,2,0,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,10,0,0,100),3,8) n3 = nrow(mat.sp3) mat.sp3.norm = decostand(mat.sp3, "norm") BD3 = sum( apply(mat.sp3.norm,2,var) ) BD3 [1] 1 mat.sp3.chordD = dist(mat.sp3.norm) BD3 = sum(mat.sp3.chordD^2) / (n3*(n3-1)) BD3 [1] 1 ======== Chi-square distance # Chi-square transformation mat.sp3 = matrix(c(1,0,0,2,0,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,10,0,0,100),3,8) n3 = nrow(mat.sp3) mat.sp3.chi = decostand(mat.sp3, "chi.sq") BD3 = sum( apply(mat.sp3.chi,2,var) ) BD3 [1] 26.35135 mat.sp3.chisqD = dist(mat.sp3.chi) BD3 = sum(mat.sp3.chisqD^2) / (n3*(n3-1)) BD3 [1] 26.35135 ======== Bray-Curtis distance # Bray-Curtis distance # Beta diversity can only be computed from the distance matrix library(PCNM) mat.sp3 = matrix(c(1,0,0,2,0,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,10,0,0,100),3,8) n3 = nrow(mat.sp3) mat.sp3.BC = vegdist(mat.sp3, "bray") BD3 = sum(mat.sp3.BC^2) / (n3*(n3-1)) BD3 [1] 0.5 ----- # Square root of Bray-Curtis distance => Simply obtained by NOT squaring the BC distances before taking the sum BD3 = sum(mat.sp3.BC) / (n3*(n3-1)) BD3 [1] 0.5 ========