Title: | 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. 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: | Ernest Guevarra [aut, cre, cph]
|
Maintainer: | Ernest Guevarra <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.1.0.9000 |
Built: | 2025-03-06 06:04:47 UTC |
Source: | https://github.com/nutriverse/sleacr |
Check coverage distribution
check_coverage_homogeneity(cov_df, k = 3, p = 0.05)
check_coverage_homogeneity(cov_df, k = 3, p = 0.05)
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. |
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
check_coverage_homogeneity(survey_data)
check_coverage_homogeneity(survey_data)
Weighted post-stratification estimation of coverage over several service delivery units
estimate_coverage_overall(cov_df, pop_df, strata, u5, p, k = 3) estimate_coverage(cov_df, cov_type = c("cf", "tc"), k = 3)
estimate_coverage_overall(cov_df, pop_df, strata, u5, p, k = 3) estimate_coverage(cov_df, cov_type = c("cf", "tc"), k = 3)
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". |
A list of overall coverage estimates with corresponding 95% confidence intervals for case-finding effectiveness and treatment coverage.
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 )
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 estimated number of cases for a condition affecting children under 5 years old in a specified survey area
get_n_cases(N, u5, p)
get_n_cases(N, u5, p)
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. |
A numeric value of the estimated number of cases in the specified survey area
## 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 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
get_n_clusters(n, n_cluster, u5, p)
get_n_clusters(n, n_cluster, u5, p)
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. |
A numeric value of the estimated number of clusters to sample to reach target sample size.
## 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 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
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)
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)
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 |
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
get_sample_n(N = 600, dLower = 0.7, dUpper = 0.9) get_sample_d(N = 600, n = 40, dLower = 0.7, dUpper = 0.9)
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
get_sampling_clusters(N_clusters, n_clusters) get_sampling_list(cluster_list, n_clusters)
get_sampling_clusters(N_clusters, n_clusters) get_sampling_list(cluster_list, n_clusters)
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. |
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
.
get_sampling_clusters(N_clusters = 211, n_clusters = 35) get_sampling_list(cluster_list = village_list, n_clusters = 70)
get_sampling_clusters(N_clusters = 211, n_clusters = 35) get_sampling_list(cluster_list = village_list, n_clusters = 70)
LQAS classifier
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 )
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 )
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. |
A data.frame()
of coverage classifications for case-finding
effectiveness and for treatment coverage.
Ernest Guevarra
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 ) )
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
lqas_get_class_prob(x)
lqas_get_class_prob(x)
x |
Simulated results data produced by |
A list object of class lqasClass
for LQAS misclassification
probabilities results
sim <- lqas_simulate_test( pop = 10000, n = 40, dLower = 0.6, dUpper = 0.9, replicates = 5, runs = 5 ) lqas_get_class_prob(x = sim)
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
Perform LQAS on simulated data based on specified decision rules
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) )
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) )
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. |
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.
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 )
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()
functionplot
helper function for lqas_simulate_test()
function
## S3 method for class 'lqasSim' plot(x, ...)
## S3 method for class 'lqasSim' plot(x, ...)
x |
An object of class |
... |
Additional |
An LQAS probability of classification plot
x <- lqas_simulate_test( pop = 10000, n = 40, dLower = 0.6, dUpper = 0.9, replicates = 5, runs = 5 ) plot(x)
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
pop_data
pop_data
A tibble with 14 rows and 2 columns
Variable | Description |
district | District name |
pop | Population |
https://sierraleone.unfpa.org/sites/default/files/pub-pdf/Population%20structure%20Report_1.pdf
pop_data
pop_data
print
helper function for lqas_get_class_prob()
functionprint
helper function for lqas_get_class_prob()
function
## S3 method for class 'lqasClass' print(x, ...)
## S3 method for class 'lqasClass' print(x, ...)
x |
An object resulting from applying the |
... |
Additional |
Printed output of lqas_get_class_prob()
function
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)
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
survey_data
survey_data
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 |
Ministry of Health, Sierra Leone
survey_data
survey_data
List of villages in Bo District, Sierra Leone
village_list
village_list
A tibble with 1001 rows and 4 columns
Variable | Description |
id | Unique identifier |
chiefdom | Chiefdom |
section | Section |
village | Village |
Ministry of Health, Sierra Leone
village_list
village_list