MyNixOS website logo
Description

Calculating Optimum Sampling Effort in Community Ecology.

A system for calculating the optimal sampling effort, based on the ideas of "Ecological cost-benefit optimization" as developed by A. Underwood (1997, ISBN 0 521 55696 1). Data is obtained from simulated ecological communities, and the optimization follows the following procedure of four functions (1) sim_beta() estimates statistical power and type 2 error by using Permutational Multivariate Analysis of Variance, (2) plot_power() represents the results of the previous function, (3) scompvar() calculates the variation components necessary for (4) sim_cbo() to calculate the optimal combination of number of sites and samples depending on either an economical budget or on a desired statistical accuracy.

ecocbo

R-CMD-check License

Calculating Optimum Sampling Effort in Community Ecology

ecocbo is an R package that helps scientists calculate the optimum sampling effort for community ecology projects. The package is based on the principles developed in the SSP package, which simulates ecological communities by extracting and using parameters that control the simulation. The simulated communities are then compared with PERMANOVA to estimate their components of variation and consequently the optimal sampling effort.

ecocbo is a valuable tool for scientists who need to design efficient sampling plans. The package can help scientists to save time and money by ensuring that they collect the minimum amount of data necessary to achieve their research goals.

Installation

You can easilly obtain ‘ecocbo’ from CRAN:

install.packages("ecocbo")

Alternatively, you can install the development version of ecocbo from GitHub:

# install.packages("devtools")
devtools::install_github("arturoSP/ecocbo")

Example

This is a basic example which shows you how to use the different functions in the package:

Prepare the data

# Load data and adjust it.
data(epiDat)

epiH0 <- epiDat
epiH0[,"site"] <- as.factor("T0")
epiHa <- epiDat
epiHa[,"site"] <- as.factor(epiHa[,"site"])

# Calculate simulation parameters.
parH0 <- SSP::assempar(data = epiH0, type = "counts", Sest.method = "average")
parHa <- SSP::assempar(data = epiHa, type = "counts", Sest.method = "average")

# Simulation.
simH0Dat <- SSP::simdata(parH0, cases = 3, N = 1000, sites = 1)
simHaDat <- SSP::simdata(parHa, cases = 3, N = 100, sites = 10)

Calculate statistical power

betaResult <- sim_beta(simH0Dat, simHaDat,
                       n = 5, m = 4, k = 30,
                       alpha = 0.05,
                       transformation = "square root", method = "bray",
                       dummy = FALSE,
                       useParallel = TRUE)
betaResult
#> Power at different sampling efforts (m x n):
#>       n = 2 n = 3 n = 4 n = 5
#> m = 2  0.50  0.75  0.84  0.97
#> m = 3  0.44  0.96  0.97  1.00
#> m = 4  0.80  1.00  1.00  1.00

Plot the power progression as sampling increases.

plot_power(data = betaResult, n = NULL, m = 3, method = "power")
This plot will look different in every simulation

Calculate components of variation.

compVar <- scompvar(data = betaResult)
compVar
#>     compVarA  compVarR
#> 1 0.09943608 0.2626768

Determine optimal sampling effort

The sampling effort can be evaluated depending on an economic budget (ct) or desired precision level (multSE), depending on the proposed parameter, the function will calculate optimal values for number of treatments (bOpt) and replicates (nOpt).

cboCost <- sim_cbo(comp.var = compVar, ct = 20000, ck = 100, cj = 2500)
cboCost
#>   nOpt mOpt
#> 1    8    6
cboPrecision <- sim_cbo(comp.var = compVar, multSE = 0.10, ck = 100, cj = 2500)
cboPrecision
#>   nOpt mOpt
#> 1    8   13

R packages required for running ecocbo

  • Required: ggplot2, ggpubr, sampling, stats, vegan
  • Suggested: SSP, knitr, rmarkdown, testthat

Participating institutions.

Metadata

Version

0.10.2

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows