Skip to content

Commit

Permalink
Merge pull request #82 from nutriverse:dev
Browse files Browse the repository at this point in the history
create post-stratification estimator; fix #71; fix #81
  • Loading branch information
ernestguevarra authored Jan 29, 2025
2 parents 56bb1a0 + 359c635 commit bf8af27
Show file tree
Hide file tree
Showing 25 changed files with 1,803 additions and 175 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
^README\.html$
^LICENSE\.md$
^vignettes/articles$
^CITATION\.cff$
217 changes: 217 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
# --------------------------------------------
# CITATION file created with {cffr} R package
# See also: https://docs.ropensci.org/cffr/
# --------------------------------------------

cff-version: 1.2.0
message: 'To cite package "sleacr" in publications use:'
type: software
license: GPL-3.0-or-later
title: 'sleacr: Simplified Lot Quality Assurance Sampling Evaluation of Access and
Coverage (SLEAC) Tools'
version: 0.1.0.9000
abstract: In the recent past, measurement of coverage has been mainly through two-stage
cluster sampled surveys either as part of a nutrition assessment or through a specific
coverage survey known as Centric Systematic Area Sampling (CSAS). However, such
methods are resource intensive and often only used for final programme evaluation
meaning results arrive too late for programme adaptation. SLEAC, which stands for
Simplified Lot Quality Assurance Sampling Evaluation of Access and Coverage, is
a low resource method designed specifically to address this limitation and is used
regularly for monitoring, planning and importantly, timely improvement to programme
quality, both for agency and Ministry of Health (MoH) led programmes. SLEAC is designed
to complement the Semi-quantitative Evaluation of Access and Coverage (SQUEAC) method.
This package provides functions for use in conducting a SLEAC assessment.
authors:
- family-names: Guevarra
given-names: Ernest
email: [email protected]
orcid: https://orcid.org/0000-0002-4887-4415
- family-names: Myatt
given-names: Mark
email: [email protected]
orcid: https://orcid.org/0000-0003-1119-1474
preferred-citation:
type: book
title: Semi-Quantitative Evaluation of Access and Coverage (SQUEAC)/Simplified Lot
Quality Assurance Sampling Evaluation of Access and Coverage (SLEAC) Technical
Reference
authors:
- name: Mark Myatt
- name: Ernest Guevarra
- name: Lionella Fieschi
- name: Allison Norris
- name: Saul Guerrero
- name: Lilly Schofield
- name: Daniel Jones
- name: Ephrem Emru
- name: Kate Sadler
year: '2012'
publisher:
name: FHI 360/FANTA
address: Washington, DC
url: https://www.fantaproject.org/sites/default/files/resources/SQUEAC-SLEAC-Technical-Reference-Oct2012_0.pdf
repository-code: https://github.com/nutriverse/sleacr
url: https://nutriverse.io/sleacr/
contact:
- family-names: Guevarra
given-names: Ernest
email: [email protected]
orcid: https://orcid.org/0000-0002-4887-4415
keywords:
- cmam
- coverage
- rstats
- sleac
references:
- type: software
title: 'R: A Language and Environment for Statistical Computing'
notes: Depends
url: https://www.R-project.org/
authors:
- name: R Core Team
institution:
name: R Foundation for Statistical Computing
address: Vienna, Austria
year: '2025'
version: '>= 4.1.0'
- type: software
title: parallel
abstract: 'R: A Language and Environment for Statistical Computing'
notes: Imports
authors:
- name: R Core Team
institution:
name: R Foundation for Statistical Computing
address: Vienna, Austria
year: '2025'
- type: software
title: parallelly
abstract: 'parallelly: Enhancing the ''parallel'' Package'
notes: Imports
url: https://parallelly.futureverse.org
repository: https://CRAN.R-project.org/package=parallelly
authors:
- family-names: Bengtsson
given-names: Henrik
email: [email protected]
orcid: https://orcid.org/0000-0002-7579-5165
year: '2025'
doi: 10.32614/CRAN.package.parallelly
- type: software
title: covr
abstract: 'covr: Test Coverage for Packages'
notes: Suggests
url: https://covr.r-lib.org
repository: https://CRAN.R-project.org/package=covr
authors:
- family-names: Hester
given-names: Jim
email: [email protected]
year: '2025'
doi: 10.32614/CRAN.package.covr
- type: software
title: knitr
abstract: 'knitr: A General-Purpose Package for Dynamic Report Generation in R'
notes: Suggests
url: https://yihui.org/knitr/
repository: https://CRAN.R-project.org/package=knitr
authors:
- family-names: Xie
given-names: Yihui
email: [email protected]
orcid: https://orcid.org/0000-0003-0645-5666
year: '2025'
doi: 10.32614/CRAN.package.knitr
- type: software
title: rmarkdown
abstract: 'rmarkdown: Dynamic Documents for R'
notes: Suggests
url: https://pkgs.rstudio.com/rmarkdown/
repository: https://CRAN.R-project.org/package=rmarkdown
authors:
- family-names: Allaire
given-names: JJ
email: [email protected]
- family-names: Xie
given-names: Yihui
email: [email protected]
orcid: https://orcid.org/0000-0003-0645-5666
- family-names: Dervieux
given-names: Christophe
email: [email protected]
orcid: https://orcid.org/0000-0003-4474-2498
- family-names: McPherson
given-names: Jonathan
email: [email protected]
- family-names: Luraschi
given-names: Javier
- family-names: Ushey
given-names: Kevin
email: [email protected]
- family-names: Atkins
given-names: Aron
email: [email protected]
- family-names: Wickham
given-names: Hadley
email: [email protected]
- family-names: Cheng
given-names: Joe
email: [email protected]
- family-names: Chang
given-names: Winston
email: [email protected]
- family-names: Iannone
given-names: Richard
email: [email protected]
orcid: https://orcid.org/0000-0003-3925-190X
year: '2025'
doi: 10.32614/CRAN.package.rmarkdown
- type: software
title: spelling
abstract: 'spelling: Tools for Spell Checking in R'
notes: Suggests
url: https://ropensci.r-universe.dev/spelling
repository: https://CRAN.R-project.org/package=spelling
authors:
- family-names: Ooms
given-names: Jeroen
email: [email protected]
orcid: https://orcid.org/0000-0002-4035-0289
- family-names: Hester
given-names: Jim
email: [email protected]
year: '2025'
identifiers:
- type: url
value: https://docs.ropensci.org/spelling/
doi: 10.32614/CRAN.package.spelling
- type: software
title: testthat
abstract: 'testthat: Unit Testing for R'
notes: Suggests
url: https://testthat.r-lib.org
repository: https://CRAN.R-project.org/package=testthat
authors:
- family-names: Wickham
given-names: Hadley
email: [email protected]
year: '2025'
doi: 10.32614/CRAN.package.testthat
version: '>= 3.0.0'
- type: software
title: tibble
abstract: 'tibble: Simple Data Frames'
notes: Suggests
url: https://tibble.tidyverse.org/
repository: https://CRAN.R-project.org/package=tibble
authors:
- family-names: Müller
given-names: Kirill
email: [email protected]
orcid: https://orcid.org/0000-0002-1416-3412
- family-names: Wickham
given-names: Hadley
email: [email protected]
year: '2025'
doi: 10.32614/CRAN.package.tibble

38 changes: 21 additions & 17 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: sleacr
Type: Package
Title: Simplified Lot Quality Assurance Sampling Evaluation of Access and
Coverage (SLEAC) Tools
Version: 0.0.0.9000
Version: 0.1.0.9000
Authors@R: c(
person("Ernest", "Guevarra",
comment = c(ORCID = "0000-0002-4887-4415"),
Expand All @@ -12,29 +12,36 @@ Authors@R: c(
comment = c(ORCID = "0000-0003-1119-1474"),
email = "[email protected]",
role = c("aut", "cph")))
Description: In the recent past, measurement of coverage has been mainly through
two-stage cluster sampled surveys either as part of a nutrition assessment
or through a specific coverage survey known as Centric Systematic Area
Sampling (CSAS). However, such methods are resource intensive and often only
used for final programme evaluation meaning results arrive too late for
programme adaptation. SLEAC, which stands for Simplified Lot Quality
Assurance Sampling Evaluation of Access and Coverage, is a low resource
method designed specifically to address this limitation and is used
regularly for monitoring, planning and importantly, timely improvement to
programme quality, both for agency and Ministry of Health (MoH) led
programmes. SLEAC is designed to complement the Semi-quantitative Evaluation
of Access and Coverage (SQUEAC) method. This package provides functions for
Description: In the recent past, measurement of coverage has been mainly through
two-stage cluster sampled surveys either as part of a nutrition assessment
or through a specific coverage survey known as Centric Systematic Area
Sampling (CSAS). However, such methods are resource intensive and often only
used for final programme evaluation meaning results arrive too late for
programme adaptation. SLEAC, which stands for Simplified Lot Quality
Assurance Sampling Evaluation of Access and Coverage, is a low resource
method designed specifically to address this limitation and is used
regularly for monitoring, planning and importantly, timely improvement to
programme quality, both for agency and Ministry of Health (MoH) led
programmes. SLEAC is designed to complement the Semi-quantitative Evaluation
of Access and Coverage (SQUEAC) method. This package provides functions for
use in conducting a SLEAC assessment.
License: GPL (>= 3)
Depends:
R (>= 2.10)
R (>= 4.1.0)
Imports:
cli,
parallel,
parallelly,
squeacr
Suggests:
covr,
knitr,
rmarkdown,
spelling,
testthat (>= 3.0.0),
tibble
Remotes:
rapidsurveys/squeacr
Encoding: UTF-8
Language: en-GB
LazyData: true
Expand All @@ -44,6 +51,3 @@ URL: https://nutriverse.io/sleacr/,https://github.com/nutriverse/sleacr
BugReports: https://github.com/nutriverse/sleacr/issues
Config/testthat/edition: 3
VignetteBuilder: knitr
Imports:
parallel,
parallelly
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

S3method(plot,lqasSim)
S3method(print,lqasClass)
export(estimate_coverage)
export(estimate_coverage_overall)
export(get_n_cases)
export(get_n_clusters)
export(get_sample_d)
Expand All @@ -16,6 +18,7 @@ export(lqas_simulate_population)
export(lqas_simulate_run)
export(lqas_simulate_runs)
export(lqas_simulate_test)
importFrom(cli,cli_abort)
importFrom(graphics,abline)
importFrom(graphics,legend)
importFrom(graphics,lines)
Expand Down
5 changes: 4 additions & 1 deletion R/03-classify_coverage.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
#'
#' @examples
#' lqas_classify_coverage(n = 6, n_total = 40)
#' with(survey_data, lqas_classify_coverage(n = in_cases, n_total = n))
#' with(
#' survey_data,
#' lqas_classify_coverage(n = cases_in, n_total = cases_total)
#' )
#'
#' @export
#' @rdname lqas_classify
Expand Down
4 changes: 2 additions & 2 deletions R/04-test_classifier.R
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ lqas_simulate_runs <- function(pop,
dUpper = dUpper,
mc.cores = cores
) |>
(\(x) do.call(rbind, x))()
do.call(rbind, args = _)

## Return result ----
result
Expand Down Expand Up @@ -218,7 +218,7 @@ lqas_simulate_test <- function(pop,
dUpper = dUpper,
mc.cores = cores
) |>
(\(x) do.call(rbind, x))()
do.call(rbind, args = _)

## concatenate parameters and results
x <- list(x, dLower, dUpper, pLower = pLower, pUpper = pUpper)
Expand Down
Loading

0 comments on commit bf8af27

Please sign in to comment.