Prevalence and Regression for Pool-Tested (Group-Tested) Data
Overview
An easy-to-use tool for working with presence/absence tests on 'pooled' or 'grouped' samples. The primary application is for estimating prevalence of a marker in a population based on the results of tests on pooled specimens. This sampling method is often employed in surveillance of rare conditions in humans or animals (e.g. molecular xenomonitoring). The package was initially conceived as an R-based alternative to the molecular xenomonitoring software, 'PoolScreen' https://sites.uab.edu/statgenetics/software/. However, it goes further, allowing for estimates of prevalence to be adjusted for hierarchical sampling frames, and perform flexible mixed-effect regression analyses (McLure et al. Environmental Modelling and Software. DOI:10.1016/j.envsoft.2021.105158). The package is currently in early stages, however more features are planned or in the works: e.g. adjustments for imperfect test specificity/sensitivity, functions for helping with optimal experimental design, and functions for spatial modelling.
Caitlin Cherryh has joined the development team and has been working on
improving readability of outputs, documentation, and testing.
This update includes an option for PoolPrev() to skip the calculation of
Bayesian estimates. When using bayesian = FALSE, only MLE and likelihood ratio
confidence intervals will be calculated, substantially speeding up this function
(perhaps x100).
This updates also removes one source of bias from prevalence estimates returned
for any hierarchical models. This effects the results of HierPoolPrev() and
getPrevalence() applied to models with random effects. Under the update,
prevalence estimates will typically slightly increase, though the difference
will not be notable if the sample size is large and there is little clustering.
Previous estimates of prevalence did not marginalise out the random effects when
Show all changes in 0.2.0Hide the rest of the changes in 0.2.0
calculating population-level prevalence, but as of this version, random effects
are marginalised out. Due to the complexity introduced by this bias-correction
we now longer-support specifying nested surveys using ~(1|Layer1/Layer2) and
recommend using the format ~(1|Layer1) + (1|Layer2) which should be equivalent
as long as each level in Layer2 is unique --- i.e. the format already required
for HierPoolPrev().
Due to the complexity introduced by this bias-correction, the way of specifying
priors for HierPoolPrev() has been updated. Priors for HierPoolPrev() are
now directly on the real-scale (logit-transformed) parameters, rather than
prevalence directly. We have also updated the default priors for PoolRegBayes()
for regression parameters, as we believe the previous priors were too diffuse
(normal(0,100)). The defaults for the centered predictors are now
student(6,0,1.5).
HierPoolPrev() now has functionality to return estimate of intracluster
correlation coefficients (ICC) at one or more levels of clustering.
HierPoolPrev() and PoolPrev() now have custom output classes (inheriting
from tibble, the previous class for these outputs). This has allowed us
(Caitlin) to add pretty-print functions these outputs which are much more human
readable. Saving the output with write.csv() or similar will still return a
detailed, machine-readable output.
Both PoolPrev() and HierPoolPrev() have been updated to improve point
estimates. New default function values have been added for both PoolPrev() and
HierPoolPrev(). The default for the new robust parameter is robust = TRUE,
which means the point estimate of prevalence is the posterior median. In both
functions, the default value for all.negative.pools = 'zero', meaning when all
pools are negative, the point estimate and the. lower bound for the interval
will be 0.
From NEWS.md in the release
Install
Health
NOTEDESCRIPTION meta-informationr-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-x86_64, r-oldrel-macos-arm64, r-oldrel-macos-x86_64, r-oldrel-windows-x86_64, r-patched-linux-x86_64, r-release-linux-x86_64, r-release-macos-arm64, r-release-macos-x86_64, r-release-windows-x86_64
r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-oldrel-macos-arm64, r-oldrel-macos-x86_64, r-patched-linux-x86_64, r-release-linux-x86_64, r-release-macos-arm64, r-release-macos-x86_64
Missing dependency on R >= 4.1.0 because package code uses the pipe
|> or function shorthand \(...) syntax added in R 4.1.0.
File(s) using such syntax:
‘getPrevalence.R’r-devel-windows-x86_64, r-oldrel-windows-x86_64, r-release-windows-x86_64
Missing dependency on R >= 4.1.0 because package code uses the pipe
|> or function shorthand \(...) syntax added in R 4.1.0.
File(s) using such syntax:
'getPrevalence.R'NOTEdependencies in R coder-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc
Namespaces in Imports field not imported from: ‘RcppParallel’ ‘rstantools’ All declared Imports should be used.
- NOTE13 NOTE2026-09-09
- ERROR12 NOTE, 1 ERROR2026-09-04
- NOTE13 NOTE2026-08-06
- ERROR12 NOTE, 1 ERROR2026-07-16
- NOTE13 NOTE2026-07-08
Show 6 earlier changesHide 6 earlier changes
- ERROR12 NOTE, 1 ERROR2026-07-07
- NOTE13 NOTE2026-06-09
- ERROR12 NOTE, 1 ERROR2026-06-08
- NOTE14 NOTE2026-04-22
- ERROR13 NOTE, 1 ERROR2026-04-18
- NOTE14 NOTE2026-03-10
Documentation
- Help pages
- 10 (1 internal)includes a package overview page
- Examples that run
- 83%5 run in a plain check · 1 only when donttest examples are enabled (R CMD check --as-cran)
- Exported functions with examples
- 100%
- Documented parameters
- 91%
- Return-value docs
- 100%
- Help pages citing references
- 20%
Downloads
Repository
- PRs merged (all time)
- 91%
- Median days to close, 50 most recently updated closed issues
- 34
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
10 development-tooling and community-health practices detected across 7 families in the upstream repository
Checks run against github.com/angusmclure/pooltestr on 2026-10-21.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Show all practicesHide 3 practices
Dependencies
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- 0.2.0Latest
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- 0.1.32022-07-01 · diff ↗
- RR 4.2.0 released · 2022-04-22
- 0.1.22022-01-19 · diff ↗
- RR 4.1.0 released · 2021-05-18
- 0.1.12021-02-15 · diff ↗
- 0.1.02021-02-08
- RR 4.0.0 released · 2020-04-24
Package metadata
- First published
- 2021-02-08
- Total releases
- 5 / 5 yrs
- License
- GPL (>= 3) OSI
- Minimum R
- ≥ 3.4.0
- Bundled data
- 18 KB / 3 files
- Download size
- 80 KB
Cite
Cite this package
Run in R for the authors' entry:
citation("PoolTestR")The package provides a citation file, so citation() returns the authors' own entry.
It points to 10.1016/j.envsoft.2021.105158.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-24, which the citation names so these numbers can be found later. More on citing and the projects behind them.