plastic.ci {placer}R Documentation

Confidence intervals of plastic prevalence probability

Description

Bootstrap simulations to estimate 95% bootstrapped CIs for the prevalence of debris obtained with different sample sizes.

Usage

plastic.ci(plastic_abs_pres, max_sample_size = 300, bs_rep = 1000,
  lower_ci = 0.025, upper_ci = 0.975)

Arguments

plastic_abs_pres

numeric vector, containing a binary values with 0 or no for absence of plastic, and 1 or yes for presence of plastic.

max_sample_size

integer, specifying the maximum number of samples to use for estimating the prevalence of plastic debris. By default 300 samples. Increasing sample sizes substantially increases computational time.

bs_rep

integer, specifying the number of bootstrap replications. By default 1000 replications.

lower_ci

numeric, specifying lower confidence interval. By default 2.5%, based on Efron and Tibshirani (1993)

upper_ci

numeric, specifying upper confidence interval. By default 97.5% default, based on Efron and Tibshirani (1993).

Value

A list (cidtf) with a data frame with sample sizes, mean CI, lower CI, upper CI, and a matrix (prevprob) with prevalence probability of plastic debris for all sample sizes and their estimated prevalence of debris.

Note

The confidence intervals are calculated in a sequence of varying sample sizes, i.e. 1,2,3...,n and the function can be also used for defining sample sizes that would provide 95% CIs with the desired accuracy.

References

Efron, B., & Tibshirani, R. (1993). An introduction to the Bootstrap. Boca Raton: Chapman & Hall.

See Also

plastic.prev.prob, prevalence_plot

Examples

plastic.ci(rbinom(1000,1,0.5), 30, 100)

[Package placer version 0.1.3 Index]