Check the plausibility and acceptability of weight-for-height z-score (WFHZ) data
Source:R/plausibility_check_wfhz.R
mw_plausibility_check_wfhz.Rd
Check the overall plausibility and acceptability of WFHZ data through a structured test suite encompassing sampling and measurement-related biases checks in the dataset. The test suite, including the criteria and corresponding rating of acceptability, follows the standards in the SMART plausibility check. The only exception is the exclusion of MUAC checks. MUAC is checked separately using more comprehensive test suite as well.
The function works on a data frame returned from this package's wrangling function for age and for WFHZ data.
Arguments
- df
A dataset object of class
data.frame
to check.- sex
A vector of class
numeric
of child's sex.- age
A vector of class
double
of child's age in months.- weight
A vector of class
double
of child's weight in kilograms.- height
A vector of class
double
of child's height in centimeters.- flags
A vector of class
numeric
of flagged records.
Value
A summarised table of class data.frame
, of length 19 and width 1, for
the plausibility test results and their respective acceptability rates.
References
SMART Initiative (2017). Standardized Monitoring and Assessment for Relief and Transition. Manual 2.0. Available at: https://smartmethodology.org.
Examples
## First wrangle age data ----
data <- mw_wrangle_age(
df = anthro.01,
dos = dos,
dob = dob,
age = age,
.decimals = 2
)
## Then wrangle WFHZ data ----
data_wfhz <- mw_wrangle_wfhz(
df = data,
sex = sex,
weight = weight,
height = height,
.recode_sex = TRUE
)
#> ================================================================================
## Now run the plausibility check ----
mw_plausibility_check_wfhz(
df = data_wfhz,
sex = sex,
age = age,
weight = weight,
height = height,
flags = flag_wfhz
)
#> # A tibble: 1 × 19
#> n flagged flagged_class sex_ratio sex_ratio_class age_ratio
#> <int> <dbl> <fct> <dbl> <chr> <dbl>
#> 1 1191 0.0101 Excellent 0.297 Excellent 0.409
#> # ℹ 13 more variables: age_ratio_class <chr>, dps_wgt <dbl>,
#> # dps_wgt_class <chr>, dps_hgt <dbl>, dps_hgt_class <chr>, sd <dbl>,
#> # sd_class <chr>, skew <dbl>, skew_class <fct>, kurt <dbl>, kurt_class <fct>,
#> # quality_score <dbl>, quality_class <fct>