pct_x_for_y | R Documentation |
Calculate weight, height, and BMI growth percentiles for age/height for infants and children using CDC Growth Charts data and equations.
pct_weight_for_age(
weight,
age,
age_units = c("years", "months", "weeks", "days"),
sex,
return_numeric = TRUE
)
pct_height_for_age(
height,
age,
age_units = c("years", "months", "weeks", "days"),
sex,
return_numeric = TRUE
)
pct_bmi_for_age(
bmi,
age,
age_units = c("years", "months", "weeks", "days"),
sex,
return_numeric = TRUE
)
pct_weight_for_height(
weight,
height,
height_units = c("centimetres", "metres", "feet", "inches"),
sex,
population = c("infants", "children"),
return_numeric = TRUE
)
weight |
A numeric vector of weights in kilograms. |
age |
A numeric vector of ages in the unit specified in |
age_units |
A character string specifying the units of all |
sex |
A character vector specifying patient sex. Either |
return_numeric |
Return a numeric vector of percentiles for the given
physical measurement? Defaults to |
height |
A numeric vector of heights in centimetres. For
|
bmi |
A numeric vector of BMI in kilograms/meters squared. |
height_units |
A character string specifying the units of all |
population |
A character string specifying the population table to use
for |
When return_numeric = TRUE
, a vector of percentiles for the given
physical measurement; when return_numeric = FALSE
, a growth chart data
frame.
CDC Growth Charts data: weight_for_age, height_for_age, bmi_for_age_children, weight_for_height_infants, weight_for_height_children
# Returns a vector of percentiles for the given physical measurement:
pct_weight_for_age(weight = 20, age = 5, sex = "female")
# Set `return_numeric = FALSE` to return a data frame with additional info:
pct_weight_for_age(
weight = 20, age = 5, sex = "female", return_numeric = FALSE
)
# Supply vectors of equal length to return information for each observation.
# This is particularly useful in calls to `dplyr::mutate()` or similar.
pct_weight_for_age(
weight = c(11, 7.2, 4.6, 4, 4.1),
age = c(9.5, 6.1, 1.5, 2, 3),
age_units = "months",
sex = c("male", "female", "male", "male", "female")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.