library(dplyr, warn.conflicts = FALSE)
library(rlang, warn.conflicts = FALSE)
cdc_htage <- admiralpeds::cdc_htage %>%
mutate(
SEX = case_when(
SEX == 1 ~ "M",
SEX == 2 ~ "F",
TRUE ~ NA_character_
),
# Ensure first that Age unit is "DAYS"
AGE = round(AGE * 30.4375),
AGEU = "DAYS"
)
# Interpolate the AGE by SEX
derive_interp_records(
dataset = cdc_htage,
by_vars = exprs(SEX),
parameter = "HEIGHT"
)
Run the code above in your browser using DataLab