IDEAS home Printed from https://ideas.repec.org/a/plo/pone00/0316650.html
   My bibliography  Save this article

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

Author

Listed:
  • Kumar P Mainali
  • Eric Slud

Abstract

1. Analysis of co-occurrence data with traditional indices has led to many problems such as sensitivity of the indices to prevalence and the same value representing either a strong positive or strong negative association across different datasets. In our recent study (Mainali et al 2022), we revealed the source of the problems that make the traditional indices fundamentally flawed and unreliable–namely that the indices in common use have no target of estimation quantifying degree of association in the non-null case–and we further developed a novel parameter 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 previous study.2. Here, we introduce the CooccurrenceAffinity R package that computes the MLE for alpha. We provide functions to perform the analysis based on a 2×2 contingency table of occurrence/co-occurrence counts as well as a m×n 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 entity pairs on matrix rows based on presence-absence recorded in columns. We also provide functions for plotting the computed indices.3. As novel components of this software paper not reported in the original study, we present theoretical discussion of a median interval and of 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.4. CooccurrenceAffinity 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, Sørensen–Dice, and Simpson.

Suggested Citation

  • Kumar P Mainali & Eric Slud, 2025. "CooccurrenceAffinity: An R package for computing a novel metric of affinity in co-occurrence data that corrects for pervasive errors in traditional indices," PLOS ONE, Public Library of Science, vol. 20(1), pages 1-18, January.
  • Handle: RePEc:plo:pone00:0316650
    DOI: 10.1371/journal.pone.0316650
    as

    Download full text from publisher

    File URL: https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0316650
    Download Restriction: no

    File URL: https://journals.plos.org/plosone/article/file?id=10.1371/journal.pone.0316650&type=printable
    Download Restriction: no

    File URL: https://libkey.io/10.1371/journal.pone.0316650?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    References listed on IDEAS

    as
    1. Bertrand Richer de Forges & J. Anthony Koslow & G. C. B. Poore, 2000. "Diversity and endemism of the benthic seamount fauna in the southwest Pacific," Nature, Nature, vol. 405(6789), pages 944-947, June.
    2. Jonathan M. Chase & Mathew A. Leibold, 2002. "Spatial scale dictates the productivity–biodiversity relationship," Nature, Nature, vol. 416(6879), pages 427-430, March.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Philip A. Loring, 2022. "Regenerative food systems and the conservation of change," Agriculture and Human Values, Springer;The Agriculture, Food, & Human Values Society (AFHVS), vol. 39(2), pages 701-713, June.
    2. repec:plo:pbio00:1000378 is not listed on IDEAS
    3. Meishun Yu & Menghui Zhang & Runying Zeng & Ruolin Cheng & Rui Zhang & Yanping Hou & Fangfang Kuang & Xuejin Feng & Xiyang Dong & Yinfang Li & Zongze Shao & Min Jin, 2024. "Diversity and potential host-interactions of viruses inhabiting deep-sea seamount sediments," Nature Communications, Nature, vol. 15(1), pages 1-17, December.
    4. Yuxuan Wu & Ping Wang & Xiaosheng Hu & Ming Li & Yi Ding & Tiantian Peng & Qiuying Zhi & Qiqige Bademu & Wenjie Li & Xiao Guan & Junsheng Li, 2024. "Plant Diversity, Productivity, and Soil Nutrient Responses to Different Grassland Degradation Levels in Hulunbuir, China," Land, MDPI, vol. 13(12), pages 1-20, November.
    5. Leilei Yang & Junhui Zhang & Jiahui Wang & Shijie Han & Zhongling Guo & Chunnan Fan & Jinghua Yu, 2024. "Relationships between Tree Species Diversity and Aboveground Biomass Are Mediated by Site-Dependent Factors in Northeastern China Natural Reserves on a Small Spatial Scale," Sustainability, MDPI, vol. 16(19), pages 1-18, September.
    6. Chase C. James & Andrew D. Barton & Lisa Zeigler Allen & Robert H. Lampe & Ariel Rabines & Anne Schulberg & Hong Zheng & Ralf Goericke & Kelly D. Goodwin & Andrew E. Allen, 2022. "Influence of nutrient supply on plankton microbiome biodiversity and distribution in a coastal upwelling region," Nature Communications, Nature, vol. 13(1), pages 1-13, December.

    More about this item

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:plo:pone00:0316650. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: plosone (email available below). General contact details of provider: https://journals.plos.org/plosone/ .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.