# mwana 0.2.5

## Bug fixes  

* Resolved an issue in `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.

## General updates 

* Refactored wasting case definers to halt execution and raise an error when oedema contains missing values.
* Revised the mathematical expression for the age-weighting approach in `mw_estimate_age_weighted_prev_muac()`. 
* Added a hyperlink to the internet‑deployed `mwana` Shiny App (`mwanaApp`) in the website’s list of links.

# mwana 0.2.4

## Bug fixes

* Resolved issue with MUAC prevalences applying age-weighting estimation when age-ratio test was rated as "problematic", even when the observed proportion of children aged 24-59 months exceeded the expected value (0.66). Going forward, prevalence is age-weighted only when the age-ratio test is problematic and the proportion of children aged 24-59 months is < 0.66. 

## General updates

* 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. 

<br>

# mwana 0.2.3

## General updates 

* 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. 

<br>

# mwana 0.2.2

## New features

* Added new functions:
    - `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.

## Bug fixes 

* Resolved an issue with `mw_check_ipcamn_ssreq()`, which was previously not returning the correct statistics for grouped analysis.

## General updates 

* 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.

<br/>

# mwana 0.2.1

## General updates

* 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

<br/>

# mwana v0.2.0

## New features

* Added new function `mw_estimate_prevalence_screening()` to estimate prevalence 
of wasting by MUAC from non survey data: screenings, sentinel sites, etc.

## Bug fixes

* 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`.

## General updates

* Updated general package documentation, including references in vignettes. 
* Built package using R version 4.4.2

<br/>

# mwana v0.1.0

* Initial pre-release version for alpha-testing.
