mw_wrangle_age() that ensures out‑of‑range age‑in‑months values are set to NA when mwana is provided with a dataset containing pre‑calculated age‑in‑months. The function already applied this rule when age‑in‑months was derived from date of birth and data‑collection date; this fix extends the same behaviour to externally supplied age‑in‑months values.mw_estimate_age_weighted_prev_muac().mwana Shiny App (mwanaApp) in the website’s list of links.Refactored MUAC‑prevalence functions to take explicit age and muac arguments in the function call, rather than accessing these variables implicitly from the dataset as in earlier versions.
Replaced anthro.04 dataset with another with the same name, but containing scenarios that match the expected behaviour of the refactored muac-prevalence functions, and then updated expectations in corresponding unit tests.
Refactored MUAC prevalence functions to return results even when standard deviation is problematic. Hereafter, users should go over the plausibility check report thoroughly before going over the prevalence results.
Refactored mw_estimate_age_weighted_prev_muac() to return MUAC-based prevalence split into 6-23 and 24-59 months, and thereafter
provide the actual age-weighted prevalence of Severe Acute Malnutrition (SAM), Moderate Acute Malnutrition (MAM) and Global Acute Malnutrition (GAM). This update ensures alignment with the SMART MUAC tool for age weighting. It is noteworthy that the main MUAC prevalence estimators only return the age‑weighted SAM, MAM, and GAM prevalence. For a full breakdown, users should use mw_estimate_age_weighted_prev_muac().
Rebuilt vignettes using quarto engine.
The mwana package has been relocated from the nutriverse GitHub organisation to the mphimo organisation.
mw_stattest_ageratio2(): Tests for statistical differences in proportions as in mw_stattest_ageratio(), but for cases where age is provided in the categories “6–23” and “24–59” months.
mw_estimate_prevalence_screening2(): Estimates the prevalence of acute malnutrition for non-survey data when age is given in the categories “6–23” and “24–59” months. This ensures that the age-weighting approach is applied when applicable. Outliers are excluded using raw MUAC rather than MUAC-for-age z-scores.
mw_check_ipcamn_ssreq(), which was previously not returning the correct statistics for grouped analysis.Refactored plausibility check and prevalence functions to allow multiple grouping variables (rather than just one, as was the case in earlier versions). The .by argument is no longer used; instead, users must specify the variable or set of variables using ... .
Reduced repeated code in several function definitions.
Updated documentation in README, data documentation function documentation, and vignettes to improve grammar, coherence, and consistency;
Enforced use of :: to state external package dependencies;
Ensured that a code sequence started with a function statement rather than a data.frame piped into a function;
simplified specific code syntax
mw_estimate_prevalence_screening() to estimate prevalence
of wasting by MUAC from non survey data: screenings, sentinel sites, etc.Resolved issues with mw_neat_output_mfaz(), mw_neat_output_wfhz() and
mw_neat_output_muac() not returning neat and tidy output for grouped data.frame from their respective plausibility checkers.
Resolved issue with oedema argument in prevalence functions that was not working as expected when set to NULL.