# NOT RUN {
## Example 1: younger age range is the default: 3 months - 5 years
# Creating a hypothetical dataset
dat1 <- data.frame(age = c(3, 5, 12, 18, 23, 24, 36, 48, 60, 24, 36, 48, 60),
sex = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2),
muac = c(15.6, 14.1, 15.8, 18.7, 12.9, 13,
14.5, 16.1, 21.7, 12.7, 14.4, 16.2, 22.5))
# Run the function
ans1 <- muaczs(Datafm = dat1) # save the output
# ans1
## Example 2: For children 5-19 years old, specify their age range "61-228"
# Creating a hypothetical dataset
dat1 <- data.frame(age = c(60, 65, 90, 120, 220),
sex = c("Male","Female","Male","Male","Female"),
muac = c(20, 14.3, 15.4, 17.8, 25.1))
ans1 <- muaczs(Datafm = dat1, age_range = "60-228")
# ans1
# }
Run the code above in your browser using DataLab