# NOT RUN {
## Example 1: for younger age range = "0-24" months
## No need to specify age_range
## creating a hypothetical dataset
dat1 <- data.frame(age = c(5, 6, 12, 12, 18, 18, 23, 23),
sex = c(1, 2, 1, 2, 1, 2, 1, 2),
bmi = c(17.3, 18.6, 18.2, 12.7, 20.8, 20.8, 13.6, 18.4))
ans1 <- bmizs(Datafm = dat1)
ans1 <- bmizs(Datafm = dat1, Notes = TRUE) # Will also print notes
# ans1
## Example 2: specify age range = "24-60" months
## creating a hypothetical dataset
dat2 <- data.frame(age = c(25, 36, 48, 60),
sex = 2, bmi = c(15.7, 16.8, 20.6, 12.7))
ans2 <- bmizs(Datafm = dat2, age_range = "24-60")
# ans2
## Example 3: specify age range = "61-228" months
## creating a hypothetical dataset
dat3 <- data.frame(age = c(61, 73, 181, 217),
sex = 1, bmi = c(12.1, 14.1, 27.1, 35.4))
ans3 <- bmizs(Datafm = dat3, age_range = "61-228")
# ans3
# }
Run the code above in your browser using DataLab