Statistics
Bray-Curtis Dissimilarity & Sorensen-Dice Ecological Similarity
Compare aligned nonnegative abundance vectors with Bray-Curtis dissimilarity and their binary presence/absence sets with Sorensen-Dice similarity, explicitly handling missing and empty samples.
Align taxa before comparing samples
Each row must refer to the same taxon in both samples, with no duplicate taxon rows. A measured absence is zero; a missing measurement must not silently become zero. The supplied five rows are an illustrative paired survey.
Bray-Curtis dissimilarity is 1-2*sum(min(Ak,Bk))/(sum(Ak)+sum(Bk)). For nonnegative data and a positive denominator it ranges from zero for identical vectors to one when no taxon has positive abundance in both. It does not track individual organisms shared between locations.
Sorensen-Dice similarity first reduces each abundance to presence (>0). It is 2*sharedTaxa/(richnessA+richnessB). It is a similarity, so larger means more overlap. One minus this value is the binary Bray-Curtis dissimilarity.
Raw Bray-Curtis reflects abundance totals as well as composition. Multiplying both samples by the same positive factor leaves it unchanged; scaling only one generally changes it. If sampling effort differs, choose and document a preprocessing method rather than assuming counts are automatically comparable.
One empty sample against a nonempty one gives Bray-Curtis 1 and Dice 0. Both empty gives a zero denominator: this worksheet reports undefined for both instead of inventing an agreement score. These are descriptive comparisons, not significance tests.
Row-wise shared minimum total, E2
The comparison products choose the lesser abundance per row. Ten numeric nonnegative entries are required. Fractional abundances are allowed if meaningful for the chosen measurement.
=IF(COUNT(B2:C6)<>10,"Enter all ten numeric abundances",IF(MIN(B2:C6)<0,"Abundances must be nonnegative",SUMPRODUCT((B2:B6<=C2:C6)*B2:B6+(B2:B6>C2:C6)*C2:C6)))Bray-Curtis dissimilarity, E3
Uses the unrounded shared minimum total and combined abundance. The original example gives 0.4.
=IF(NOT(ISNUMBER(E2)),E2,IF(SUM(B2:C6)=0,"Both samples empty: undefined",1-2*E2/SUM(B2:C6)))Binary Sorensen-Dice similarity, E4
There are four present taxa in A, five in B and four shared, so the example gives 8/9, approximately 0.8889. Retain full precision and round only for display.
=IF(COUNT(B2:C6)<>10,"Enter all ten numeric abundances",IF(MIN(B2:C6)<0,"Abundances must be nonnegative",IF(SUM(B2:C6)=0,"Both samples empty: undefined",2*SUMPRODUCT((B2:B6>0)*(C2:C6>0))/(COUNTIF(B2:B6,">0")+COUNTIF(C2:C6,">0")))))Try the example
Use the original values or change them to test your understanding.