Skip to contents

Calculate wasting prevalence by MUAC

Usage

calculate_unweighted_prevalence(
  muac,
  muac_units = c("mm", "cm"),
  oedema,
  oedema_recode = NULL,
  status = c("sam", "mam")
)

calculate_weighted_prevalence(
  age,
  sex,
  sex_recode = NULL,
  muac,
  muac_units = c("mm", "cm"),
  oedema,
  oedema_recode = NULL,
  status = c("sam", "mam")
)

ipc_calculate_prevalence(df, status = c("sam", "mam"))

Arguments

muac

A numeric value or vector of numeric values for MUAC measurement of child. The expected values for MUAC are in millimetres. If units are different, use muac_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 value or a vector of values for oedema status of child. The expected values for oedema is 1 = for presence of oedema and 2 for no oedema. If data values are different, use oedema_recode to map out the values to what is required.

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.

status

Which wasting anthropometric indicator to report. A choice between c("sam", "mam"). Default to "sam"

age

A numeric or integer value or vector of values for age of child. The age of child should be in months.

sex

A value or a vector of values for sex of child. The expected values for sex is 1 = males; 2 = females. If data values are different, use sex_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.

df

A data.frame for a MUAC dataset on which appropriate checks have been applied already produced via a call to ipc_muac_check() with the .summary argument set to FALSE.

Value

A single value, a vector of values, or a table providing a prevalence

Examples

calculate_unweighted_prevalence(
  muac = muac_data$muac,
  oedema = muac_data$oedema,
  status = "sam"
)
#> [1] 1

ipc_muac_check(
  muac_data, age = "age", sex = "sex",
  muac = "muac", muac_units = "cm",
  oedema = "oedema", oedema_recode = c(1, 2),
  .summary = FALSE
) |>
ipc_calculate_prevalence()
#> [1] 0.1768535