Calculate material percentage uncertainty from observed particle counts
Source:R/material_percentage_uncertainty.R
material_percentage_uncertainty.RdCalculates the absolute confidence-interval half-width for an observed material-class percentage from the total number of particles characterized. The calculation is the single-property proportion equation described by Cowger et al. (2024), rearranged to solve for error after observation.
Arguments
- count
positive whole-number total particle count. May be a scalar or a numeric vector.
- percentage
observed material-class percentage in the closed interval 0–100. May be a scalar or a numeric vector.
- confidence
confidence level in the open interval 0–1. Defaults to 0.95. May be a scalar or a numeric vector.
Value
A numeric vector containing absolute uncertainty half-widths in percentage points. Inputs must either have length one or share one common length.
Details
For proportion p = percentage / 100, total observed count n, and
two-tailed normal critical value z, the returned half-width is
100 * abs(z) * sqrt(p * (1 - p) / n). This is a material-composition
uncertainty under representative random particle sampling. It does not
include laboratory, spectral-identification, concentration, finite-
population, or multiple-property uncertainty. In particular, the published
Wald-style equation returns zero at exactly 0 and 100 percent.
References
Cowger W, Markley LAT, Moore S, Gray AB, Upadhyay K, Koelmans AA (2024). "How many microplastics do you need to (sub)sample?" Ecotoxicology and Environmental Safety, 275, 116243. doi:10.1016/j.ecoenv.2024.116243 .
Examples
material_percentage_uncertainty(100, c(20, 50, 80))
#> [1] 7.839856 9.799820 7.839856
material_percentage_uncertainty(100, 50, confidence = 0.90)
#> [1] 8.224268