Search bioRxiv⌕ Search

Biology subjects

Mainali, K. P.

Publications and source records attributed to Mainali, K. P..

1 recordsLinked to original sources

CooccurrenceAffinity: An R package for computing a novel metric of affinity in co-occurrence data that corrects for pervasive errors in traditional indices

O_LIAnalysis of co-occurrence data in ecology and biogeography with traditional indices has led to many problems. In our recent study (Mainali, Slud, Singer, & Fagan, 2022), we revealed the source of the problem that makes the traditional indices fundamentally flawed and completely unreliable, and we further developed a novel metric of association, alpha, with complete formulation of the null distribution for estimating the mechanism of affinity. We also developed the maximum likelihood estimate (MLE) of alpha in our prior study. C_LIO_LIHere, we introduce the CooccurrenceAffinity R package that computes alpha MLE. We provide functions to perform the analysis based on a 2x2 contingency table of occurrence/co-occurrence counts as well as a mxn presence-absence matrix (e.g., species by site matrix). The flexibility of the function allows a user to compute the alpha MLE for entity pairs on matrix columns based on presence-absence states recorded in the matrix rows, or for entities on matrix rows based on presence-absence recorded in columns. We also provide functions for plotting the computed indices. C_LIO_LIAs novel components of this software paper not reported in the original study, we present theoretical discussions about median interval and four types of confidence intervals; we further develop functions (a) to compute those intervals, (b) to evaluate their true coverage probability of enclosing the population parameter, and (c) to generate figures. C_LIO_LICooccurrenceAffinity is a practical and efficient R package with user-friendly functions for end-to-end analysis and plotting of co-occurrence data in various formats, making it possible to compute the recently developed metric of alpha MLE as well as its median and confidence intervals introduced in this paper. The package supplements its main output of the novel metric of association with the three most common traditional indices of association in co-occurrence data: Jaccard, Sorensen-Dice, and Simpson. C_LI

ecology↗