Skip to contents

Calculate the observed age ratio of children aged 24 to 59 months old over those aged 6 to 23 months old and test if there is a statistical difference between the observed and the expected.

Usage

mw_stattest_ageratio(age, .expectedP = 0.66)

Arguments

age

A vector of class numeric of child's age in months. If different than expected, the function will stop execution and return an error message indicating the type of mismatch.

.expectedP

The expected proportion of children aged 24 to 59 months old over those aged 6 to 23 months old. This is estimated to be 0.66.

Value

A vector of class list of three statistics: p for p-value of the statistical difference between the observed and the expected proportion of children aged 24 to 59 months old over those aged 6 to 23 months old; observedR and observedP for the observed ratio and proportion respectively.

Details

This function should be used specifically when assessing the quality of MUAC data. For age ratio test of children aged 6 to 29 months old over 30 to 59 months old, as performed in the SMART plausibility check, use nipnTK::ageRatioTest() instead.

References

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

Examples

mw_stattest_ageratio(
  age = anthro.02$age,
  .expectedP = 0.66
)
#> $p
#> [1] 0.8669039
#> 
#> $observedR
#> [1] 1.955671
#> 
#> $observedP
#> [1] 0.6616674
#>