Description Usage Arguments Details Value Examples
Uses CDC height and weight expected values to determine anomalies in height and weight values for cleaning purposes.
1 2 | clean_htwt(df, HEIGHT = HEIGHT, WEIGHT = WEIGHT, SEX = SEX, TIME = TIME,
BIRTH_DT = BIRTH_DT, AGE_M = AGE_M)
|
df |
Data frame containing weight, height, the time weight and height were collected, sex, and eighter birth date or age in months. |
HEIGHT |
Column name for patient height (cm). |
WEIGHT |
Column name for patient weight (kg). |
SEX |
Column name for patient sex 0 = female, 1 = male. |
TIME |
Column name for dates when corresponding height and weight values were collected. Must be R datetime object. |
BIRTH_DT |
Column name for birth date of patient. Must be R date or datetime object. |
AGE_M |
Column name for age of patient in months. |
See https://www.cdc.gov/growthcharts/percentile_data_files.htm for data sources used to detect anomalies. Z-scores are calculated based on LMS parameters as described in [1]. If subject is greater than 20 years old, height and weight will be compared to the distribution for a 20 year old.
If any dataframe input column has a different name, define that columns name in the input parameters (See Examples). See http://r4ds.had.co.nz chapters 11.4, 11.5 and 16 for creating date or datetime R objects.
1. Flegal KM, Cole TJ. Construction of LMS parameters for the Centers for Disease Control and prevention 2000 growth chart. National health statistics reports; no 63. Hyattsville, MD: National Center for Health Statistics. 2013.
Returns a data frame identifying height weight anomalies with specific colums:
HT_Z: Z score on expected distribution of height for age and sex.
WT_Z: Z score on expected distribution of Weight for age and sex.
1 2 3 4 5 | htwt <- clean_htwt(htwt_example, HEIGHT = HT, WEIGHT = WT)
htwt
# filter out results for outside of 5th and 95th percentile
htwt <- dplyr::filter(htwt, abs(HT_Z) > 1.96 | abs(WT_Z) > 1.96)
htwt
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.