Perform MUAC check based on IPC and CDC recommendations
Usage
ipc_muac_check(
df,
age = "age",
sex = "sex",
sex_recode = NULL,
muac = "muac",
muac_units = c("mm", "cm"),
oedema = "oedema",
oedema_recode = NULL,
.summary = TRUE,
.list = TRUE
)
summarise_muac_check(df, .summary = TRUE, .list = TRUE)
Arguments
- df
A data.frame with information on age, sex, oedema status, and MUAC of each child
- age
A character value for name of variable in
df
for age of child. The age of child should be in months.- sex
A character value for name of variable in
df
for sex of child. The expected values forsex
is 1 = males; 2 = females. If data values are different, usesex_recode
to map out the values to what is required.- sex_recode
A vector of values with length of 2 with the first element for the value signifying males and second element for the value signifying females in the dataset. For example, if "m" is the value for males and "f" is the value for females, then specify
c("m", "f)
. If set to NULL (default), then the values c(1, 2) are used.- muac
A character value for name of variable in
df
for MUAC measurement of child. The expected values for MUAC are in millimetres. If units are different, usemuac_units
to specify which units are used.- muac_units
A character value for units used for MUAC measurement. Currently accepts either "mm" for millimetres (default) or "cm" for centimetres.
- oedema
A character value for name of variable in
df
for oedema status of child. The expected values foroedema
is 1 = for presence of oedema and 2 for no oedema. If data values are different, useoedema_recode
to map out the values to what is required. If dataset does not have oedema values, set this to NULL.- oedema_recode
A vector of values with length of 2 with the first element for the value signifying presence of oedema and second element for the value signifying no oedema in the dataset. For example, if "y" is the value for presence of oedema and "n" is the value for no oedema, then specify
c("y", "n)
. If set to NULL (default), then the values c(1, 0) are used.- .summary
Logical. Should output be a summary of all the checks performed on the MUAC dataset? If TRUE (default), output will be a single row data.frame with each column for each metric used to check MUAC dataset. If FALSE, a data.frame with same number of rows as
df
and columns for each metric used to check MUAC dataset is added todf
. Setting.summary
to FALSE is usually only used for when the output structure is required for further analysis (i.e., calculation of prevalence).- .list
Logical. Relevant only if
.summary
is TRUE. Should summary be given in list format? If TRUE (default), then the output is in list format otherwise a data.frame is provided.
Value
A data.frame with a single row with each column for each metric used
to check MUAC dataset if .summary
is TRUE. If .summary
is FALSE, a
data.frame with same number of rows as df
and columns for each metric
used to check MUAC dataset is added to df
.
Examples
ipc_muac_check(df = muac_data, oedema_recode = c(1, 2), muac_units = "cm")
#> $`Age Ratio`
#> $`Age Ratio`$ratio
#> [1] Inf
#>
#> $`Age Ratio`$p
#> [1] 7.785732e-113
#>
#> $`Age Ratio`$class
#> [1] "Problematic"
#>
#>
#> $`Sex Ratio`
#> $`Sex Ratio`$ratio
#> p
#> 0.5057471
#>
#> $`Sex Ratio`$p
#> [1] 0.8479104
#>
#> $`Sex Ratio`$class
#> [1] "Excellent"
#>
#>
#> $`Digit Preference`
#> $`Digit Preference`$score
#> [1] 16.35
#>
#> $`Digit Preference`$class
#> [1] "Acceptable"
#>
#>
#> $`Standard Deviation`
#> $`Standard Deviation`$std_dev
#> [1] 12.45931
#>
#> $`Standard Deviation`$class
#> [1] "Excellent"
#>
#>
#> $`Data Quality`
#> $`Data Quality`$score
#> [1] 1
#>
#> $`Data Quality`$class
#> [1] "Partially OK"
#>
#>