View source: R/map-quantiles.R
| map_nhanes_pa_quantiles | R Documentation |
map_nhanes_pa_quantiles() adds a population-level quantile column to a
participant-level data frame. Quantiles are evaluated from NHANES
accelerometer cumulative distribution functions stratified by age category,
sex/gender, measure, and optionally survey wave.
map_nhanes_pa_quantiles(
data,
id = NULL,
age = "age",
sex = "sex",
measure = "measure",
value = "value",
wave = NULL,
age_category = NULL,
quantile_col = "nhanes_quantile"
)
data |
A data frame with one row per participant-measure observation. |
id |
Optional participant identifier column name. The column is checked when supplied, but otherwise left unchanged. |
age, sex, measure, value |
Column names in |
wave |
Optional NHANES wave column name or scalar value. Supported values
are |
age_category |
Optional column name containing NHANES age categories
such as |
quantile_col |
Name of the output quantile column. |
data with an added quantile column.
example_data <- data.frame(
id = 1:2,
age = c(25, 62),
sex = c("Female", "Male"),
measure = c("mims", "ssl_steps"),
value = c(15000, 7500)
)
map_nhanes_pa_quantiles(example_data)
map_nhanes_pa_quantiles(example_data, sex = NULL)
map_nhanes_pa_quantiles(example_data, age = NULL, wave = "2011-2012")
map_nhanes_pa_quantiles(example_data, age = NULL, sex = NULL)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.