View source: R/material_percentage_uncertainty.R
| material_percentage_uncertainty | R Documentation |
Calculates 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.
material_percentage_uncertainty(count, percentage, confidence = 0.95)
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. |
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.
A numeric vector containing absolute uncertainty half-widths in percentage points. Inputs must either have length one or share one common length.
Win Cowger
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. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.ecoenv.2024.116243")}.
material_percentage_uncertainty(100, c(20, 50, 80))
material_percentage_uncertainty(100, 50, confidence = 0.90)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.