Skip to contents

Check the overall plausibility and acceptability of WFHZ data through a structured test suite encompassing checks for sampling and measurement-related biases in the dataset. The test suite, including the criteria and corresponding rating of acceptability, follows the standards in the SMART plausibility check.

The function works on a data frame returned by this package's wrangling functions for age and for WFHZ data.

Usage

mw_plausibility_check_wfhz(df, sex, age, weight, height, flags)

Arguments

df

A tibble object to check.

sex

A numeric vector for child's sex with 1 = males and 2 = females.

age

A vector of class double of child's age in months.

weight

A vector of class double of child's weight in kilograms.

height

A vector of class double of child's height in centimeters.

flags

A numeric vector of flagged records.

Value

A single row summary tibble with 19 columns for the plausibility check results and their respective acceptability rates.

References

SMART Initiative (2017). Standardized Monitoring and Assessment for Relief and Transition. Manual 2.0. Available at: https://smartmethodology.org.

Examples

## First wrangle age data ----
data <- mw_wrangle_age(
  df = anthro.01,
  dos = dos,
  dob = dob,
  age = age,
  .decimals = 2
)

## Then wrangle WFHZ data ----
data_wfhz <- mw_wrangle_wfhz(
  df = data,
  sex = sex,
  weight = weight,
  height = height,
  .recode_sex = TRUE
)
#> ================================================================================

## Now run the plausibility check ----
mw_plausibility_check_wfhz(
  df = data_wfhz,
  sex = sex,
  age = age,
  weight = weight,
  height = height,
  flags = flag_wfhz
)
#> # A tibble: 1 × 19
#>       n flagged flagged_class sex_ratio sex_ratio_class age_ratio
#>   <int>   <dbl> <fct>             <dbl> <chr>               <dbl>
#> 1  1191  0.0101 Excellent         0.297 Excellent           0.409
#> # ℹ 13 more variables: age_ratio_class <chr>, dps_wgt <dbl>,
#> #   dps_wgt_class <chr>, dps_hgt <dbl>, dps_hgt_class <chr>, sd <dbl>,
#> #   sd_class <chr>, skew <dbl>, skew_class <fct>, kurt <dbl>, kurt_class <fct>,
#> #   quality_score <dbl>, quality_class <fct>