Skip to contents

Calculate the prevalence estimates of wasting based on MUAC and/or bilateral edema. Before estimating, the function evaluates the quality of data by calculating and rating the standard deviation of z-scores of muac-for-age (MFAZ) and the p-value of the age ratio test; then it sets the analysis path that best fits the data:

  • If all tests are rated as not problematic, a normal analysis is done.

  • If standard deviation is not problematic and age ratio test is problematic, prevalence is age-weighted. This is to fix the likely overestimation of wasting when there are excess of younger children in the data set.

  • If standard deviation is problematic and age ratio test is not, or both are problematic, analysis gets cancelled out and NAs get thrown.

Outliers are detected based on SMART flags on the MFAZ values and then get excluded prior being piped into the actual prevalence analysis workflow.

Usage

mw_estimate_prevalence_muac(df, wt = NULL, edema = NULL, .by = NULL)

mw_estimate_smart_age_wt(df, edema = NULL, .by = NULL)

Arguments

df

A data set object of class data.frame to use. This must have been wrangled using this package's wrangling function for MUAC data. Make sure MUAC values are converted to millimeters after using the wrangler. If this is not done, the function will stop execution and return an error message. The function uses a variable name called cluster where the primary sampling unit IDs are stored. Make sure the data set has this variable and its name has been renamed to cluster, otherwise the function will error and terminate the execution.

wt

A vector of class double of the final survey weights. Default is NULL assuming a self weighted survey, as in the ENA for SMART software; otherwise, when a vector of weights if supplied, weighted analysis is done.

edema

A vector of class character of edema. Code should be "y" for presence and "n" for absence of bilateral edema. Default is NULL.

.by

A vector of class character or numeric of the geographical areas or respective IDs for where the data was collected and for which the analysis should be summarized at.

Value

A summarized table of class data.frame of the descriptive statistics about wasting.

References

SMART Initiative (no date). Updated MUAC data collection tool. Available at: https://smartmethodology.org/survey-planning-tools/updated-muac-tool/

Examples

## When .by = NULL ----
mw_estimate_prevalence_muac(
  df = anthro.04,
  wt = NULL,
  edema = edema,
  .by = NULL
)
#> # A tibble: 1 × 3
#>    sam_p  mam_p gam_p
#>    <dbl>  <dbl> <dbl>
#> 1 0.0212 0.0889 0.110

## When .by is not set to NULL ----
mw_estimate_prevalence_muac(
  df = anthro.04,
  wt = NULL,
  edema = edema,
  .by = province
)
#> # A tibble: 3 × 17
#>   province   gam_n  gam_p gam_p_low gam_p_upp gam_p_deff sam_n   sam_p sam_p_low
#>   <chr>      <dbl>  <dbl>     <dbl>     <dbl>      <dbl> <dbl>   <dbl>     <dbl>
#> 1 Province 1   135  0.104    0.0778     0.130        Inf    19  0.0133   0.00682
#> 2 Province 2    NA  0.112   NA         NA             NA    NA  0.0201  NA      
#> 3 Province 3    NA NA       NA         NA             NA    NA NA       NA      
#> # ℹ 8 more variables: sam_p_upp <dbl>, sam_p_deff <dbl>, mam_n <dbl>,
#> #   mam_p <dbl>, mam_p_low <dbl>, mam_p_upp <dbl>, mam_p_deff <dbl>,
#> #   wt_pop <dbl>

## An application of `mw_estimate_smart_age_wt()` ----
.data <- anthro.04 |>
  subset(province == "Province 2")

mw_estimate_smart_age_wt(
  df = .data,
  edema = edema,
  .by = NULL
)
#> # A tibble: 1 × 3
#>    sam_p  mam_p gam_p
#>    <dbl>  <dbl> <dbl>
#> 1 0.0201 0.0922 0.112