| Type: | Package |
| Title: | Simplified Lot Quality Assurance Sampling Evaluation of Access and Coverage (SLEAC) Tools |
| Version: | 0.1.3 |
| 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 (≥ 4.2.0) |
| Imports: | cli, methods, parallel, parallelly, stats |
| Suggests: | covr, knitr, rmarkdown, spelling, testthat (≥ 3.0.0), tibble |
| Encoding: | UTF-8 |
| Language: | en-GB |
| LazyData: | true |
| RoxygenNote: | 7.3.3 |
| URL: | https://nutriverse.io/sleacr/, https://github.com/nutriverse/sleacr |
| BugReports: | https://github.com/nutriverse/sleacr/issues |
| Config/testthat/edition: | 3 |
| VignetteBuilder: | knitr |
| NeedsCompilation: | no |
| Packaged: | 2026-01-31 21:40:03 UTC; ernestguevarra |
| Author: | Ernest Guevarra |
| Maintainer: | Ernest Guevarra <ernest@guevarra.io> |
| Repository: | CRAN |
| Date/Publication: | 2026-02-03 14:30:02 UTC |
Simplified Lot Quality Assurance Sampling Evaluation of Access and Coverage (SLEAC) Tools
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. This package provides functions for use in conducting a SLEAC assessment.
Author(s)
Maintainer: Ernest Guevarra ernest@guevarra.io (ORCID) [copyright holder]
Authors:
Mark Myatt mark@brixtonhealth.com (ORCID) [copyright holder]
References
Myatt, Mark et al. 2012. Semi-Quantitative Evaluation of Access and Coverage (SQUEAC)/Simplified Lot Quality Assurance Sampling Evaluation of Access and Coverage (SLEAC) Technical Reference. Washington, DC: FHI 360/FANTA.
See Also
Useful links:
Report bugs at https://github.com/nutriverse/sleacr/issues
Calculate case-finding effectiveness
Description
Calculate case-finding effectiveness
Usage
calculate_cf(cin, cout)
Calculate r_out
Description
Calculate r_out
Usage
calculate_rout(cin, cout, rin, k = 3)
Calculate treatment coverage
Description
Calculate treatment coverage
Usage
calculate_tc(cin, cout, rin, k = 3)
Calculate post-stratification weights
Description
Calculate post-stratification weights
Usage
calculate_weights(pop_df, u5, p)
Check coverage data for post-stratification weighted estimation
Description
Check coverage data for post-stratification weighted estimation
Usage
check_coverage_data(cov_df)
Arguments
cov_df |
A |
Value
A message or an error on whether cov_df is structured
appropriately for post-stratification weighted estimation.
Check coverage distribution
Description
Check coverage distribution
Usage
check_coverage_homogeneity(cov_df, k = 3, p = 0.05)
Arguments
cov_df |
A |
k |
Correction factor. Ratio of the mean length of an untreated episode to the mean length of a CMAM treatment episode |
p |
Minimum p-value to test statistic. Default is 0.05. |
Value
A named list of 2 lists: one for case-finding effectiveness (cf) and the second for treatment coverage (tc). For each list, the following values are provided:
-
statistic - calculated chi-square statistic
-
df - degrees of freedom
-
p - p-value of chi-square statistic
Examples
check_coverage_homogeneity(survey_data)
Check p value
Description
Check p value
Usage
check_p(p)
Check population data for post-stratification weighted estimation
Description
Check population data for post-stratification weighted estimation
Usage
check_pop_data(pop_df)
Arguments
pop_df |
A |
Value
A message or an error on whether pop_df is structured
appropriately for post-stratification weighted estimation.
Weighted post-stratification estimation of coverage over several service delivery units
Description
Weighted post-stratification estimation of coverage over several service delivery units
Usage
estimate_coverage_overall(cov_df, pop_df, strata, u5, p, k = 3)
estimate_coverage(cov_df, cov_type = c("cf", "tc"), k = 3)
Arguments
cov_df |
A |
pop_df |
A |
strata |
A character value of the variable name in |
u5 |
A numeric value for the proportion of the population that is under years old. |
p |
Prevalence of SAM or MAM in the given population. |
k |
Correction factor. Ratio of the mean length of an untreated episode to the mean length of a CMAM treatment episode |
cov_type |
Coverage estimator to report. Either "cf" for case-finding effectiveness or "tc" for treatment coverage. Default is "cf". |
Value
A list of overall coverage estimates with corresponding 95% confidence intervals for case-finding effectiveness and treatment coverage.
Examples
cov_df <- survey_data
pop_df <- pop_data |>
setNames(nm = c("strata", "pop"))
estimate_coverage_overall(
cov_df, pop_df, strata = "district", u5 = 0.177, p = 0.01
)
Calculate the binomial coefficient n-choose-k
Description
Calculate the binomial coefficient n-choose-k
Usage
get_binom_hypergeom(n, k)
Arguments
n |
Total population |
k |
Number of sample drawn from total population |
Value
A numeric value of binomial probability
Get low, moderate, and high probabilities per proportion
Description
Get low, moderate, and high probabilities per proportion
Usage
get_classification_probabilities(x)
Arguments
x |
A vector of low, moderate, and high classification labelled as 1, 2, and 3 respectively. |
Value
A table object of low, moderate, and high classification probabilities
Calculate hypergeometric probability
Description
Calculate hypergeometric probability
Usage
get_hypergeom(k, m, n, N)
Arguments
k |
Number of cases in the sample |
m |
Number of cases in the population |
n |
Sample size |
N |
Population size |
Value
A numeric value of hypergeometric probability given specified parameters
Calculate cumulative hypergeometric probabilities
Description
Calculate cumulative hypergeometric probabilities
Usage
get_hypergeom_cumulative(k, m, n, N, tail = "lower")
Arguments
k |
Number of cases in the sample |
m |
Number of cases in the population |
n |
Sample size |
N |
Population size |
tail |
A character vector indicating "lower" (default) or "upper" tail |
Value
A numeric value of cumulative hypergeometric probability given specified parameters
Calculate estimated number of cases for a condition affecting children under 5 years old in a specified survey area
Description
Calculate estimated number of cases for a condition affecting children under 5 years old in a specified survey area
Usage
get_n_cases(N, u5, p)
Arguments
N |
Population for all ages in the specified survey area. |
u5 |
Proportion (value from 0 to 1) of population that are aged 6-59 months. |
p |
Prevalence (value from 0 to 1) of condition that is to be assessed. |
Value
A numeric value of the estimated number of cases in the specified survey area
Examples
## Calculate number of SAM cases in a population of 100000 persons of all
## ages with an under-5 population of 17% and a prevalence of 2%
get_n_cases(N = 100000, u5 = 0.17, p = 0.02)
Calculate number of clusters to sample to reach target sample size
Description
Calculate number of clusters to sample to reach target sample size
Usage
get_n_clusters(n, n_cluster, u5, p)
Arguments
n |
Target sample size of cases for the coverage survey. |
n_cluster |
Average cluster population for all ages in the specified survey area. |
u5 |
Proportion (value from 0 to 1) of population that are aged 6-59 months. |
p |
Prevalence (value from 0 to 1) of condition that is to be assessed. |
Value
A numeric value of the estimated number of clusters to sample to reach target sample size.
Examples
## Calculate number of villages to sample given an average village population
## of 600 persons of all ages with an under-5 population of 17% and a
## prevalence of SAM of 2% if the target sample size is 40
get_n_clusters(n = 40, n_cluster = 600, u5 = 0.17, p = 0.02)
Calculate sample size and decision rule for a specified LQAS sampling plan
Description
Calculate sample size and decision rule for a specified LQAS sampling plan
Usage
get_sample_n(N, dLower, dUpper, alpha = 0.1, beta = 0.1)
get_sample_d(N, n, dLower, dUpper, alpha = 0.1, beta = 0.1)
Arguments
N |
Total population size of cases in the specified survey area |
dLower |
Lower triage threshold. Values from 0 to 1. |
dUpper |
Upper triage threshold. Values from 0 to 1. |
alpha |
Maximum tolerable alpha error. Values from 0 to 1. Default is 0.1 |
beta |
Maximum tolerable beta error. Values from 0 to 1. Default is 0.1 |
n |
Sample size |
Value
A list of values providing the LQAS sampling plan for the specified parameters. The list includes sample size, decision rule, alpha error and beta error for the specified classification scheme
Examples
get_sample_n(N = 600, dLower = 0.7, dUpper = 0.9)
get_sample_d(N = 600, n = 40, dLower = 0.7, dUpper = 0.9)
Select sampling clusters using systematic sampling
Description
Select sampling clusters using systematic sampling
Usage
get_sampling_clusters(N_clusters, n_clusters)
get_sampling_list(cluster_list, n_clusters)
Arguments
N_clusters |
Total number of clusters in survey area. |
n_clusters |
Number of sampling clusters to be selected. |
cluster_list |
A data.frame containing at least the name or any other identifier for the entire set of clusters to sample from. |
Value
An integer vector for get_sampling_clusters() giving the row
index for selected clusters. A data.frame for [get_sampling_list()] which
is a subset of cluster_list.
Examples
get_sampling_clusters(N_clusters = 211, n_clusters = 35)
get_sampling_list(cluster_list = village_list, n_clusters = 70)
LQAS classifier
Description
LQAS classifier
Usage
lqas_classify_(
cases_in,
cases_out,
rec_in = NULL,
k = 3,
threshold = c(0.2, 0.5),
label = FALSE
)
lqas_classify(
cases_in,
cases_out,
rec_in = NULL,
k = 3,
threshold = c(0.2, 0.5),
label = FALSE
)
lqas_classify_cf(cases_in, cases_out, threshold = c(0.2, 0.5), label = FALSE)
lqas_classify_tc(
cases_in,
cases_out,
rec_in,
k,
threshold = c(0.2, 0.5),
label = FALSE
)
Arguments
cases_in |
Number of SAM and/or MAM cases found during the survey who are in the CMAM programme. |
cases_out |
Number of SAM and/or MAM cases found during the survey who are in the CMAM programme. |
rec_in |
Number of children recovering from SAM or MAM found during the survey who are in the programme. |
k |
Correction factor. Ratio of the mean length of an untreated episode to the mean length of a CMAM treatment episode |
threshold |
Decision rule threshold/s. Should be between 0 and 1. At least one threshold should be provided for a two-tier classifier. Two thresholds should be provided for a three-tier classifier. Default is a three-tier classifier with rule set at 0.2 and 0.5. |
label |
Logical. Should the output results be classification labels? If TRUE, output classification are character labels else they are integer values. Default is FALSE. |
Value
A data.frame() of coverage classifications for case-finding
effectiveness and for treatment coverage.
Author(s)
Ernest Guevarra
Examples
lqas_classify(cases_in = 6, cases_out = 34, rec_in = 6)
with(
survey_data,
lqas_classify(
cases_in = cases_in, cases_out = cases_out, rec_in = rec_in
)
)
Produce misclassification probabilities
Description
Produce misclassification probabilities
Usage
lqas_get_class_prob(x)
Arguments
x |
Simulated results data produced by |
Value
A list object of class lqasClass for LQAS misclassification
probabilities results
Examples
sim <- lqas_simulate_test(
pop = 10000, n = 40, dLower = 0.6, dUpper = 0.9, replicates = 5, runs = 5
)
lqas_get_class_prob(x = sim)
Simulate survey data of covered/cases and non-covered/non-cases given a coverage/prevalence proportion
Description
Simulate survey data of covered/cases and non-covered/non-cases given a coverage/prevalence proportion
Perform LQAS on simulated data based on specified decision rules
Usage
lqas_simulate_population(proportion, pop)
lqas_simulate_run(proportion, pop, n, dLower, dUpper)
lqas_simulate_runs(
pop,
n,
dLower,
dUpper,
pLower = 0,
pUpper = 1,
fine = 0.01,
runs = 50,
cores = parallelly::availableCores(omit = 1)
)
lqas_simulate_test(
pop,
n,
dLower,
dUpper,
pLower = 0,
pUpper = 1,
fine = 0.01,
runs = 50,
replicates = 20,
cores = parallelly::availableCores(omit = 1)
)
Arguments
proportion |
A numeric value of a coverage/prevalence proportion to simulate on. Values should be between 0 and 1. |
pop |
Population size from which simulated coverage survey data is to be taken from. |
n |
Sample size of actual or test coverage data. |
dLower |
A numeric value for the lower classification threshold proportion. Value should be between 0 and 1. |
dUpper |
A numeric value for the upper classification threshold proportion. Value should be between 0 and 1. |
pLower |
Starting proportion for simulations. Default is 0. |
pUpper |
Ending proportion for simulations. Default is 1. |
fine |
Granularity of simulated proportions. Default is 0.01. |
runs |
Number of simulation runs to perform per coverage proportion. Default is 50 runs. |
cores |
The number of computer cores to use/number of child processes will be run simultaneously. |
replicates |
Number of replicate LQAS simulations to perform. Default is set to 20 replicates. |
Value
A data.frame with 2 variables: id for unique identifier and case
for numeric vector of cases and non-cases (1s and 0s)
A data.frame with variable cases for total number of
covered/cases, outcome for LQAS outcome, and proportion for the
coverage/prevalence proportion being simulated on. For
[lqas_simulate_test()], a 'sleac“ class object.
Examples
lqas_simulate_population(proportion = 0.3, pop = 10000)
lqas_simulate_run(
proportion = 0.3, pop = 10000, n = 40, dLower = 0.6, dUpper = 0.9
)
lqas_simulate_runs(
pop = 10000, n = 40, dLower = 0.6, dUpper = 0.9, runs = 10
)
lqas_simulate_test(
pop = 10000, n = 40, dLower = 0.6, dUpper = 0.9, runs = 5, replicates = 5
)
plot helper function for lqas_simulate_test() function
Description
plot helper function for lqas_simulate_test() function
Usage
## S3 method for class 'lqasSim'
plot(x, ...)
Arguments
x |
An object of class |
... |
Additional |
Value
An LQAS probability of classification plot
Examples
x <- lqas_simulate_test(
pop = 10000, n = 40, dLower = 0.6, dUpper = 0.9, replicates = 5, runs = 5
)
plot(x)
Population data of districts of Sierra Leone based on 2015 census
Description
Population data of districts of Sierra Leone based on 2015 census
Usage
pop_data
Format
A tibble with 14 rows and 2 columns
| Variable | Description |
| district | District name |
| pop | Population |
Source
https://sierraleone.unfpa.org/sites/default/files/pub-pdf/Population%20structure%20Report_1.pdf
Examples
pop_data
print helper function for lqas_get_class_prob() function
Description
print helper function for lqas_get_class_prob() function
Usage
## S3 method for class 'lqasClass'
print(x, ...)
Arguments
x |
An object resulting from applying the |
... |
Additional |
Value
Printed output of lqas_get_class_prob() function
Examples
sim <- lqas_simulate_test(
pop = 10000, n = 40, dLower = 0.6, dUpper = 0.9, replicates = 5, runs = 5
)
x <- lqas_get_class_prob(x = sim)
print(x)
SLEAC survey data from Sierra Leone
Description
SLEAC survey data from Sierra Leone
Usage
survey_data
Format
A tibble with 14 rows and 6 columns
| Variable | Description |
| country | Country |
| province | Province |
| district | District |
| cases_in | SAM cases found who are in the programme |
| cases_out | SAM cases found who are not in the programme |
| rec_in | Recovering SAM cases in the programme |
| cases_total | Total number SAM cases found |
Source
Ministry of Health, Sierra Leone
Examples
survey_data
List of villages in Bo District, Sierra Leone
Description
List of villages in Bo District, Sierra Leone
Usage
village_list
Format
A tibble with 1001 rows and 4 columns
| Variable | Description |
| id | Unique identifier |
| chiefdom | Chiefdom |
| section | Section |
| village | Village |
Source
Ministry of Health, Sierra Leone
Examples
village_list