Skip to contents

Define if a given observation in the dataset is wasted or not, on the basis of WFHZ, MFAZ, MUAC and the combined criteria.

Usage

define_wasting_cases_muac(muac, edema = NULL, cases = c("gam", "sam", "mam"))

define_wasting_cases_whz(zscore, edema = NULL, cases = c("gam", "sam", "mam"))

define_wasting_cases_combined(
  zscore,
  muac,
  edema = NULL,
  cases = c("cgam", "csam", "cmam")
)

define_wasting(
  df,
  zscore = NULL,
  muac = NULL,
  edema = NULL,
  base = c("wfhz", "muac", "combined")
)

Arguments

muac

A vector of class integer of MUAC values in millimeters.

edema

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

cases

A choice of the form of wasting to be defined.

zscore

A vector of class double of WFHZ values (with 3 decimal places).

df

A dataset object of class data.frame to use.

base

A choice of the criterion on which the case-definition should be based.

Value

A vector of class numeric of dummy values: 1 for case and 0 for not case.

Details

Use define_wasting() to add the case-definitions to data frame.

Examples


## Weight-for-height based case-definition ----
x <- anthro.02 |>
define_wasting(
zscore = wfhz,
edema = edema,
base = "wfhz"
)
head(x)
#> # A tibble: 6 × 17
#>   province strata cluster   sex   age weight height edema  muac wtfactor   wfhz
#>   <chr>    <chr>    <int> <dbl> <dbl>  <dbl>  <dbl> <chr> <dbl>    <dbl>  <dbl>
#> 1 Zambezia Rural      391     1  6.01    8.2   68   n       152     825.  0.349
#> 2 Zambezia Rural      404     2  6.01    7.1   65.1 n       139     287. -0.006
#> 3 Zambezia Rural      399     1  6.11    7.6   64.1 n       155     130.  0.9  
#> 4 Zambezia Urban      430     2  6.14    7.9   65.9 n       148    1277.  0.876
#> 5 Zambezia Urban      468     2  6.28    6.6   59.7 n       132     792.  1.38 
#> 6 Zambezia Urban      517     2  6.34    6     61.8 n       129     480. -0.583
#> # ℹ 6 more variables: flag_wfhz <dbl>, mfaz <dbl>, flag_mfaz <dbl>, gam <dbl>,
#> #   sam <dbl>, mam <dbl>

## MUAC-based case-definition ----
x <- anthro.02 |>
define_wasting(
muac = muac,
edema = edema,
base = "muac"
)
head(x)
#> # A tibble: 6 × 17
#>   province strata cluster   sex   age weight height edema  muac wtfactor   wfhz
#>   <chr>    <chr>    <int> <dbl> <dbl>  <dbl>  <dbl> <chr> <dbl>    <dbl>  <dbl>
#> 1 Zambezia Rural      391     1  6.01    8.2   68   n       152     825.  0.349
#> 2 Zambezia Rural      404     2  6.01    7.1   65.1 n       139     287. -0.006
#> 3 Zambezia Rural      399     1  6.11    7.6   64.1 n       155     130.  0.9  
#> 4 Zambezia Urban      430     2  6.14    7.9   65.9 n       148    1277.  0.876
#> 5 Zambezia Urban      468     2  6.28    6.6   59.7 n       132     792.  1.38 
#> 6 Zambezia Urban      517     2  6.34    6     61.8 n       129     480. -0.583
#> # ℹ 6 more variables: flag_wfhz <dbl>, mfaz <dbl>, flag_mfaz <dbl>, gam <dbl>,
#> #   sam <dbl>, mam <dbl>

## Combined case-definition ----
x <- anthro.02 |>
define_wasting(
zscore = wfhz,
muac = muac,
edema = edema,
base = "combined"
)
head(x)
#> # A tibble: 6 × 17
#>   province strata cluster   sex   age weight height edema  muac wtfactor   wfhz
#>   <chr>    <chr>    <int> <dbl> <dbl>  <dbl>  <dbl> <chr> <dbl>    <dbl>  <dbl>
#> 1 Zambezia Rural      391     1  6.01    8.2   68   n       152     825.  0.349
#> 2 Zambezia Rural      404     2  6.01    7.1   65.1 n       139     287. -0.006
#> 3 Zambezia Rural      399     1  6.11    7.6   64.1 n       155     130.  0.9  
#> 4 Zambezia Urban      430     2  6.14    7.9   65.9 n       148    1277.  0.876
#> 5 Zambezia Urban      468     2  6.28    6.6   59.7 n       132     792.  1.38 
#> 6 Zambezia Urban      517     2  6.34    6     61.8 n       129     480. -0.583
#> # ℹ 6 more variables: flag_wfhz <dbl>, mfaz <dbl>, flag_mfaz <dbl>, cgam <dbl>,
#> #   csam <dbl>, cmam <dbl>