Package 'pedbp'

Title: Pediatric Blood Pressure
Description: Data and utilities for estimating pediatric blood pressure percentiles by sex, age, and optionally height (stature) as described in Martin et.al. (2022) <doi:10.1001/jamanetworkopen.2022.36918>. Blood pressure percentiles for children under one year of age come from Gemelli et.al. (1990) <doi:10.1007/BF02171556>. Estimates of blood pressure percentiles for children at least one year of age are informed by data from the National Heart, Lung, and Blood Institute (NHLBI) and the Centers for Disease Control and Prevention (CDC) <doi:10.1542/peds.2009-2107C> or from Lo et.al. (2013) <doi:10.1542/peds.2012-1292>. The flowchart for selecting the informing data source comes from Martin et.al. (2022) <doi:10.1542/hpeds.2021-005998>.
Authors: Peter DeWitt [aut, cre] , Blake Martin [ctb] , David Albers [ctb] , Tell Bennett [ctb]
Maintainer: Peter DeWitt <[email protected]>
License: GPL-2
Version: 2.0.1
Built: 2024-11-15 06:11:49 UTC
Source: https://github.com/dewittpe/pedbp

Help Index


BMI for Age - Pediatric Growth Standard

Description

BMI for age quantile, distribution, and zscore function based on LMS data from the CDC and WHO.

Usage

p_bmi_for_age(q, male, age, source = getOption("pedbp_pgs_source", "CDC"), ...)

q_bmi_for_age(p, male, age, source = getOption("pedbp_pgs_source", "CDC"), ...)

z_bmi_for_age(q, male, age, source = getOption("pedbp_pgs_source", "CDC"), ...)

Arguments

q

a vector of quantiles

male

integer value, 1 = male, 0 = female

age

numeric age, in months

source

a character string denoting the data source providing the parameters needed for the estimate. Valid values are "CDC" and "WHO". This can be set explicitly, or by using the pedbp_pgs_source option.

...

pass through

p

a vector of probabilities

Value

p_ method return values from the estimated distribution function.

q_ methods return values from the estimated quantile function.

z_ methods return standard scores.

Notes

CDC Recommends using WHO growth charts for infants and children ages 0 to 2 years of age in the U.S. and CDC growth charts to monitor growth for children age 2 years and older in the U.S.

References

https://www.cdc.gov/growthcharts/percentile_data_files.htm, https://www.who.int/tools/child-growth-standards/standards

See Also

Examples

# The 54th quantile BMI (kg * m^(-2)) for a six year (72 month) old female
# is
bmi <- q_bmi_for_age(p = 0.54, male = 0, age = 72.0)
all.equal(p_bmi_for_age(q = bmi, male = 0, age = 72), 0.54)
all.equal(z_bmi_for_age(q = bmi, male = 0, age = 72), qnorm(0.54))

# Find the 29th percentile for females from ages 0 through 6 years in three
# month increments.  Sourcing the only CDC will generate a warning;
# suppressed in this example.
ages <- seq(0, 72, by = 1)
bmi_29 <-
  data.frame(
    age = ages
  , "CDC"     = suppressWarnings(q_bmi_for_age(p = 0.29, male = 0, age = ages, source = "CDC"))
  , "WHO"     = q_bmi_for_age(p = 0.29, male = 0, age = ages, source = "WHO")
  )

plot(
    x = bmi_29$age
  , y = bmi_29$WHO
  , col = 1
  , pch = 16
  , xlab = "Age (months)", ylab = "29th percentile BMI (kg * m^(-2))"
  , type = "b"
)
points(x = bmi_29$age, y = bmi_29$CDC, col = 2, pch = 17, type = "b")
legend("bottomright", col = 1:2, pch = 16:17, legend = c("WHO", "CDC"))

Plot the CDF for Blood Pressure

Description

Plot the CDF for blood pressure given age, sex, and height.

Usage

bp_cdf(...)

## S3 method for class 'pedbp_bp'
bp_cdf(x, ...)

## S3 method for class 'pedbp_p_bp'
bp_cdf(x, ...)

## S3 method for class 'pedbp_q_bp'
bp_cdf(x, ...)

## Default S3 method:
bp_cdf(
  age,
  male,
  height = NA,
  height_percentile = 0.5,
  source = getOption("pedbp_bp_source", "martin2022"),
  sbp = NA,
  dbp = NA,
  ...
)

Arguments

...

not currently used

x

a pedbp_bp object created by q_bp or p_bp.

age

numeric age, in months

male

integer value, 1 = male, 0 = female

height

numeric, in centimeters, can be missing. See Details.

height_percentile

height percentile to use; range from [0, 100]. See Details.

source

the method, or data set, to use as the reference. See Details.

sbp

the observed systolic blood pressure

dbp

the observed diastolic blood pressure

Value

When passing in a pedbp_bp object, the return is a list of ggplot objects. The length of the list is equal to the length of the number of quantiles or percentiles within the pedbp_bp object.

When using the default method the return is just a ggplot object showing the CDF for diastolic and systolic blood pressures with vertical and horizontal lines highlight the percentile for the given inputs.

Examples

# Explicity defining the inputs
bp_cdf(age = 96, male = 1, sbp = 103, dbp = 55)

# Plotting two cdfs from a call to p_bp
x <- p_bp(q_sbp = rep(100, 2),
          q_dbp = rep( 60, 2),
          age   = rep(35.75, 2),
          male  = c(0, 0),
          height = c(NA, 100))

bp_cdf(x)

# Plotting a cdf from a call to q_bp
x <- q_bp(p_sbp = 0.85, p_dbp = 0.95,
          age = 29.2, male = 0, height_percentile = 0.95,
          source = "flynn2017")

bp_cdf(x)

Blood Pressure Charts

Description

Build blood pressure charts showing select percentile curves over age by sex, height, and source.

Usage

bp_chart(
  bp = c("sbp", "dbp"),
  male = 0:1,
  height = NA,
  height_percentile = NA,
  default_height_percentile = 0.5,
  p = c(0.01, 0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95, 0.99),
  source = getOption("pedbp_bp_source", "martin2022")
)

Arguments

bp

character vector controlling if the systolic and/or the diastolic pressures are plotted

male

integer value, 1 = male, 0 = female

height

numeric, in centimeters, can be missing. See Details.

height_percentile

height percentile to use; range from [0, 100]. See Details.

default_height_percentile

default height percentile to use if height is missing; range (0, 100).

p

a numeric vector of the percentiles, provided in values between 0 and 1, to plot

source

the method, or data set, to use as the reference. See Details.

Examples

bp_chart(male = 0:1)
bp_chart(male = 1)
bp_chart(male = 0)
bp_chart(male = 0, source = "gemelli1990")
bp_chart("sbp", male = 0, source = "gemelli1990")
bp_chart("dbp", male = 1, source = "gemelli1990")

bp_chart("sbp", male = 1, source = "nhlbi")
bp_chart("sbp", male = 1, source = "flynn2017")

# if you want to modify the plot, it might be helpful to see the data it is
# based on
g <- bp_chart(male = 1)
head(g$data)

# here we color the background to show the source reference values
bkgrnd <- aggregate(x = age ~ male + bp + source, data = g$data, FUN = range)

g +
  ggplot2::theme_bw() +
  ggplot2::geom_rect(
    data = bkgrnd,
    mapping = ggplot2::aes(xmin = age[, 1],
                           xmax = age[, 2] + 1,
                           ymin = -Inf,
                           ymax = Inf,
                           fill = source)
  ) +
  ggplot2::scale_fill_manual(
    name = "Data\nSource",
    values = c("gemelli1990" = ggplot2::alpha("#236192", 0.5)
               , "nhlbi"  = ggplot2::alpha("#6F263D", 0.5)
               , "lo2013"     = ggplot2::alpha("#A2AAAD", 0.5)
               ))

Pediatric Blood Pressure Distribution

Description

Distribution and quantile functions for pediatric blood pressure.

Usage

p_bp(
  q_sbp,
  q_dbp,
  age,
  male,
  height = NA,
  height_percentile = NA,
  default_height_percentile = 50,
  source = getOption("pedbp_bp_source", "martin2022"),
  ...
)

q_bp(
  p_sbp,
  p_dbp,
  age,
  male,
  height = NA,
  height_percentile = NA,
  default_height_percentile = 50,
  source = getOption("pedbp_bp_source", "martin2022"),
  ...
)

z_bp(
  q_sbp,
  q_dbp,
  age,
  male,
  height = NA,
  height_percentile = NA,
  default_height_percentile = 50,
  source = getOption("pedbp_bp_source", "martin2022"),
  ...
)

Arguments

q_sbp

a vector of systolic blood pressures

q_dbp

a vector of diastolic blood pressures

age

numeric age, in months

male

integer value, 1 = male, 0 = female

height

numeric, in centimeters, can be missing. See Details.

height_percentile

height percentile to use; range from [0, 100]. See Details.

default_height_percentile

default height percentile to use if height is missing; range (0, 100).

source

the method, or data set, to use as the reference. See Details.

...

not currently used

p_sbp

a vector of systolic blood probabilities; range from [0, 1].

p_dbp

a vector of diastolic blood probabilities; range from [0, 1].

Details

source is used to specify the method or source data sets by which the distributions are estimated. This can be controlled by the option pedbp_bp_source. End users are encouraged to set the option if not using the default so all calls to these functions will use the same source.

Options:

  • martin2022 (default) uses a combination of references to generate distribution values for ages 1 months through 18 years, without or without known stature. This was the only method implemented in version 1 of the pedbp package.

  • gemelli1990 uses only the reference values from Gemelli et al. (1990). These values are applicable to patients from 1 month to 12 months of age. Stature is not used in the look up for the parameters.

  • lo2013 uses only the reference values from Lo et al. (2013). This is applicable to patients of at least three years of age. Height is not considered when looking up the parameters.

  • nhlbi uses only reference values from the National Heart, Lung, and Blood Institute [NHLBI] and the Centers for Disease Control and Prevention [CDC] published in 2011. These are for patients of at least one year of age and with a known stature. These values were publish

  • flynn2017 uses only reference values from Flynn et al. (2017). These values are similar to the nhlbi values _but_ "do not include children and adolescents with overweight and obesity (ie, those with a BMI >= 85th percentile).

There is a hierarchy for the use of the height, height_percentile, and default_height_percentile. If height is provided, it takes precedence over the other two arguments. height_percentile is used if height is missing and takes precedence over default_height_percentile. The height is only needed if using the nhlbi or flynn2017 data sources (including as part of the martin2022 workflow).

Value

A pedbp_bp object. This is a list of two numeric vectors for the systolic and diastolic pressure respectively. The names for the vectors depends on the call. p_bp returns a list of vectors with the names: sbp_p and dbp_p. q_bp returns a list of vectors with names: sbp and dbp. z_bp returns a list of vectors with names: sbp_z and dbp_z.

Additionally, a pedbp_bp object has a bp_params attribute which provides details on the data source and parameters used in the estimates.

References

Gemelli, Marina, Rosa Manganaro, Carmelo Mamì, and F. De Luca. "Longitudinal study of blood pressure during the 1st year of life." European journal of pediatrics 149 (1990): 318-320.

Lo, Joan C., Alan Sinaiko, Malini Chandra, Matthew F. Daley, Louise C. Greenspan, Emily D. Parker, Elyse O. Kharbanda et al. "Prehypertension and hypertension in community-based pediatric practice." Pediatrics 131, no. 2 (2013): e415-e424.

"Expert panel on integrated guidelines for cardiovascular health and risk reduction in children and adolescents: summary report." Pediatrics 128, no. Suppl 5 (2011): S213. <doi:10.1542/peds.2009-2107C>

The Fourth Report on the Diagnosis, Evaluation, and Treatment of High Blood Pressure in Children and Adolescents National High Blood Pressure Education Program Working Group on High Blood Pressure in Children and Adolescents Pediatrics 2004;114;555-576 <doi:10.1542/peds.114.2.S2.555>

Flynn, Joseph T., David C. Kaelber, Carissa M. Baker-Smith, Douglas Blowey, Aaron E. Carroll, Stephen R. Daniels, Sarah D. De Ferranti et al. "Clinical practice guideline for screening and management of high blood pressure in children and adolescents." Pediatrics 140, no. 3 (2017).

See Also

vignette("bp-distributions", package = "pedbp"), bp_cdf for plotting cumulative distribution functions for the blood pressures.

Examples

x <- p_bp(q_sbp = 100, q_dbp = 60, age = 8, male = 0)
x
str(x)

x <- p_bp(q_sbp = c(NA, 82), q_dbp = c(60, 72), age = 9.2, male = 0)
x
str(x)

x <- p_bp(q_sbp = c(NA, 82), q_dbp = c(60, 72), age = 29.2, male = 0, height = 82.8)
x
str(x)

x <- q_bp(p_sbp = 0.78, p_dbp = 0.65, age = 8, male = 0)
x
str(x)

#############################################################################
# compare results when height is known or unknown
p_bp(q_sbp = rep(100, 2),
     q_dbp = rep( 60, 2),
     age   = rep(35.75, 2),
     male  = c(0, 0),
     height = c(NA, 100))

#############################################################################
# Working with multiple patients records
d <- read.csv(system.file("example_data", "for_batch.csv", package = "pedbp"))
d

bp_percentiles <-
  p_bp(
      q_sbp = d$sbp..mmHg.
    , q_dbp = d$dbp..mmHg.
    , age   = d$age_months
    , male  = d$male
    )
bp_percentiles

# Standard (z) scores:
z_bp(
    q_sbp = d$sbp..mmHg.
  , q_dbp = d$dbp..mmHg.
  , age   = d$age_months
  , male  = d$male
  )

q_bp(
    p_sbp = bp_percentiles$sbp_p
  , p_dbp = bp_percentiles$dbp_p
  , age   = d$age_months
  , male  = d$male
  )


#############################################################################
# Selecting different source values

# default
p_bp(q_sbp = 92, q_dbp = 60, age = 29.2, male = 0, default_height_percentile = 0.95,
     source = "martin2022")
p_bp(q_sbp = 92, q_dbp = 60, age = 29.2, male = 0, default_height_percentile = 0.95,
     source = "gemelli1990")
p_bp(q_sbp = 92, q_dbp = 60, age = 29.2, male = 0, default_height_percentile = 0.95,
     source = "lo2013")
p_bp(q_sbp = 92, q_dbp = 60, age = 29.2, male = 0, default_height_percentile = 0.95,
     source = "nhlbi")
p_bp(q_sbp = 92, q_dbp = 60, age = 29.2, male = 0, default_height_percentile = 0.95,
     source = "flynn2017")

q_bp(p_sbp = 0.85, p_dbp = 0.85, age = 29.2, male = 0, default_height_percentile = 0.95,
     source = "martin2022") # default
q_bp(p_sbp = 0.85, p_dbp = 0.85, age = 29.2, male = 0, default_height_percentile = 0.95,
     source = "gemelli1990")
q_bp(p_sbp = 0.85, p_dbp = 0.85, age = 29.2, male = 0, default_height_percentile = 0.95,
     source = "lo2013")
q_bp(p_sbp = 0.85, p_dbp = 0.85, age = 29.2, male = 0, default_height_percentile = 0.95,
     source = "nhlbi")
q_bp(p_sbp = 0.85, p_dbp = 0.85, age = 29.2, male = 0, default_height_percentile = 0.95,
     source = "flynn2017")

Data Sets Informing Blood Pressure Percentile Estimates

Description

A collection of data sets from multiple sources used to inform blood pressure percentiles for pediatrics patients by sex, age, and height (if known).

Usage

lo2013

gemelli1990

nhlbi_bp_norms

flynn2017

bp_parameters

Format

An object of class data.frame with 30 rows and 6 columns.

An object of class data.frame with 8 rows and 6 columns.

An object of class data.frame with 952 rows and 6 columns.

An object of class data.frame with 714 rows and 6 columns.

An object of class data.frame with 514 rows and 8 columns.

Details

Data sets are named to reflect the source.

For all the data sets provided units are uniform:

age:

Patient age; months

height:

length/height/stature; cm

weight:

kilograms

male:

integer value; 1 = male, 0 = female

sbp:

systolic blood pressure; mmHg

dbp:

diastolic blood pressure; mmHg

Columns with a name such as sbp is a point observations. Summary statistics are appended to the variable as needed, e.g., sbp_mean and sbp_sd for the reported mean and standard deviation of systolic blood pressure.

CDC ages represent whole month but reported at the half month. That is, age = 12.5 is short-hand for 12 <= age < 13. The exception is birth; age = 0 is birth and not a range.

bp_parameters has the estimated mean and standard deviations for estimating percentiles using a Gaussian distribution for a given sex, age (in months), and height (if known/applicable).

References

Expert Panel on Integrated Guidelines for Cardiovascular Health and Risk Reduction in Children and Adolescents. "Expert panel on integrated guidelines for cardiovascular health and risk reduction in children and adolescents: summary report." Pediatrics 128.Supplement_5 (2011): S213-S256.

Gemelli, M., Manganaro, R., Mami, C., & De Luca, F. (1990). Longitudinal study of blood pressure during the 1st year of life. European journal of pediatrics, 149(5), 318-320.

Lo, Joan C., et.al. "Prehypertension and hypertension in community-based pediatric practice." Pediatrics 131.2 (2013): e415-e424.

The Fourth Report on the Diagnosis, Evaluation, and Treatment of High Blood Pressure in Children and Adolescents National High Blood Pressure Education Program Working Group on High Blood Pressure in Children and Adolescents Pediatrics 2004;114;555-576 <doi:10.1542/peds.114.2.S2.555>

Flynn, Joseph T., David C. Kaelber, Carissa M. Baker-Smith, Douglas Blowey, Aaron E. Carroll, Stephen R. Daniels, Sarah D. De Ferranti et al. "Clinical practice guideline for screening and management of high blood pressure in children and adolescents." Pediatrics 140, no. 3 (2017).

See Also

vignette("bp-distributions", package = "pedbp")


Pediatric Blood Pressure

Description

Pediatric Blood Pressure quantile and probability (distribution function) values

Usage

cppBP(
  qp_sbp,
  qp_dbp,
  age,
  male,
  height,
  height_percentile,
  default_height_percentile,
  source,
  type
)

Arguments

qp_sbp

the quantile(s) or probability(s) for systolic blood pressure

qp_dbp

the quantile(s) or probability(s) for diastolic blood pressure

age

numeric vector, in months

male

integer vector; 0 = female, 1 = male

height

numeric vector of stature

height_percentile

numeric vector for height percentiles, expected values between 0 and 1.

default_height_percentile

default height percentile to use if height is missing

source

the method, or data set, to use as the reference.

type

quantile or distribution to return

Details

height is used preferentially over height_percentile over default_height_percentile.

source can be one of "gemelli1990", "lo2013", "nhlbi", "flynn2017", or "martin2022".

Value

A list:

[[1]] systolic blood pressure quantiles or probability (defined by the input value of type). [[2]] diastolic blood pressure quantiles or probability (defined by the input value of type).

attr(, "bp_params") is a data.frame with the values for the look up table(s) needed to inform the sbp and dbp values.


Pediatric Growth Standards

Description

Pediatric growth standard based on LMS data from the CDC and WHO.

Usage

cppPGSF(metric, source, male, x, qp, type)

Arguments

metric

string, for example bmi_for_age

source

string, CDC or WHO

male

integer, 0 = female; 1 = male

x

is the age (in months), length (cm) or height (cm) as needed for the metric.

qp

the quantile or percentile, whichever is relevant for the type

type

quantile, distribution, or zscore

Details

expect to call this from R after checking some functional arguments within R.


Distribution, Quantile, and Z-scores by LMS values

Description

Functions for getting estimated distribution, quantile, and standard scores (z-scores) given LMS parameters.

Usage

zlms(x, l, m, s, ...)

plms(x, l, m, s, ...)

qlms(x, l, m, s, ...)

Arguments

x

quantile or probability value

l, m, s

the lms values

...

pass through

Details

The parameters need to be either length 1 or of equal length.

L is the power in the Box-Cox transformation, M the median, and S a generalized coefficient of variation. For a given standard score (z-score), Z, the value X of interest is

X={M(1+LSZ)1/LL0Mexp(SZ)L=0.X = \begin{cases} M (1 + LSZ)^{1/L} & L \neq 0 \\ M \exp(SZ) & L = 0. \end{cases}

To get the z-score for a value X:

Z={(XM)L1LSL0log(XM)SL=0.Z = \begin{cases} \frac{ \left(\frac{X}{M}\right)^{L} - 1 }{LS} & L \neq 0 \\ \frac{\log\left(\frac{X}{M}\right)}{S} & L = 0. \end{cases}

Value

a numeric vector

References

Cole, Timothy J., and Pamela J. Green. "Smoothing reference centile curves: the LMS method and penalized likelihood." Statistics in medicine 11.10 (1992): 1305-1319.

Examples

l <- -0.1600954
m <-  9.476500305
s <-  0.11218624

# the 5th quantile:
qlms(x = 0.05, l = l, m = m, s = s)

# What percentile is the value 8.2?
plms(x = 8.2, l = l, m = m, s = s)

# What is the standard score for the value 8.2
zlms(x = 8.2, l = l, m = m, s = s)

all.equal(
  zlms(x = 8.2, l = l, m = m, s = s)
  ,
  qnorm(plms(x = 8.2, l = l, m = m, s = s))
)

# get all the quantiles form the 5th through 95th for a set of LMS parameters
ps <- seq(0.05, 0.95, by = 0.05)
qs <- qlms(x = ps, l = l, m = m, s = s)
all.equal(plms(qs, l, m, s), ps)
all.equal(zlms(x = qs, l = l, m = m, s = s), qnorm(ps))

Estimate Normal Distribution Given Set of Quantile Values

Description

With at least two quantile values find the mean and standard deviation of a normal distribution to match up with empirical values provided.

Usage

est_norm(q, p, weights = rep(1, length(p)), ...)

Arguments

q

quantile values.

p

probabilities corresponding to the q quantiles.

weights

relative weight of each quantile. The higher the weight the better the approximated distribution will be at fitting that quantile.

...

additional arguments passed to optim. See Details.

Details

For X ~ N(mu, sigma), Pr[X <= q] = p

Given the set of quantiles and probabilities, est_norm uses optim (with method = "L-BFGS-B", lower = c(-Inf, 0), upper = c(Inf, Inf)) to find the preferable mean and standard deviation of a normal distribution to fit the provided quantiles.

Use the weight argument to emphasize which, if any, of the provided quantiles needs to be approximated closer than others. By default all the quantiles are weighted equally.

Value

a pedbp_est_norm object. This is a list with elements:

  • par: a named numeric vector with the mean and standard deviation for a Gaussian distribution

  • qp: a numeric matrix with two columns built from the input values of q and p

  • weights: the weights used

  • call: The call made

  • optim: result from calling optim

Examples

# Example 1
q <- c(-1.92, 0.1, 1.89) * 1.8 + 3.14
p <- c(0.025, 0.50, 0.975)

x <- est_norm(q, p)
str(x)
x

plot(x)

# Example 2 -- build with quantiles that are easy to see unlikely to be from
# a Normal distribuiton
q <- c(-1.92, 0.05, 0.1, 1.89) * 1.8 + 3.14
p <- c(0.025, 0.40, 0.50, 0.975)

# with equal weights
x <- est_norm(q, p)
x
plot(x)

# weight to ignore one of the middle value and make sure to hit the other
x <- est_norm(q, p, weights = c(1, 2, 0, 1))
x
plot(x)

# equal weight the middle, more than the tails
x <- est_norm(q, p, weights = c(1, 2, 2, 1))
x
plot(x)

Pediatric Growth Standard Distribution Functions

Description

Growth standards based on data from the Centers for Disease Control and the World Health Organization.

Arguments

q

a vector of quantiles

p

a vector of probabilities

male

integer value, 1 = male, 0 = female

age

numeric age, in months

length, height

in centimeters

source

a character string denoting the data source providing the parameters needed for the estimate. Valid values are "CDC" and "WHO". This can be set explicitly, or by using the pedbp_pgs_source option.

...

pass through

Value

p_ method return values from the estimated distribution function.

q_ methods return values from the estimated quantile function.

z_ methods return standard scores.

Notes

CDC Recommends using WHO growth charts for infants and children ages 0 to 2 years of age in the U.S. and CDC growth charts to monitor growth for children age 2 years and older in the U.S.

References

https://www.cdc.gov/growthcharts/percentile_data_files.htm, https://www.who.int/tools/child-growth-standards/standards

See Also


Cumulative Distribution Plots for Pediatric Growth Standards

Description

Cumulative Distribution Plots for Pediatric Growth Standards

Usage

gs_cdf(
  metric,
  male,
  age,
  height,
  length,
  source = getOption("pedbp_pgs_source", "CDC")
)

Arguments

metric

a character string denoting which growth metric to plot

male

integer value, 1 = male, 0 = female

age

numeric age, in months

length, height

in centimeters

source

a character string denoting the data source providing the parameters needed for the estimate. Valid values are "CDC" and "WHO". This can be set explicitly, or by using the pedbp_pgs_source option.

Value

a ggplot object

See Also

Examples

# Plot a # 13 year old male with a bmi of 21
gs_chart(metric = "bmi_for_age", male = 1) +
  ggplot2::geom_point(x = 13 * 12, y = 21)

gs_cdf(metric = "bmi_for_age", male = 1, age = 13*12) +
  ggplot2::geom_point(x = 21, y = p_bmi_for_age(21, male = 1, age = 13*12))

Pediatric Growth Standard Charts

Description

Growth standards based on data from the Centers for Disease Control and the World Health Organization.

Usage

gs_chart(
  metric,
  male = 0:1,
  source = getOption("pedbp_pgs_source", "CDC"),
  p = c(0.01, 0.05, 0.1, 0.25, 0.5, 0.75, 0.9, 0.95, 0.99)
)

Arguments

metric

character string, one of the growth standards

male

integer value, 1 = male, 0 = female

source

a character string denoting the data source providing the parameters needed for the estimate. Valid values are "CDC" and "WHO". This can be set explicitly, or by using the pedbp_pgs_source option.

p

a numeric vector of the probabilities, provided in values between 0 and 1, to plot

Value

A ggplot object

Notes

CDC Recommends using WHO growth charts for infants and children ages 0 to 2 years of age in the U.S. and CDC growth charts to monitor growth for children age 2 years and older in the U.S.

References

https://www.cdc.gov/growthcharts/percentile_data_files.htm, https://www.who.int/tools/child-growth-standards/standards

See Also

Examples

gs_chart("bmi_for_age", male = 0)
gs_chart("bmi_for_age", male = 1)
gs_chart("bmi_for_age", male = 0:1)

# add a point for a specific patient
pt <- data.frame(p = 0.82, age = 156, bmi = q_bmi_for_age(p = 0.82, male = 1, age = 156))
gs_chart("bmi_for_age", male = 1) +
  ggplot2::geom_point(data = pt, mapping = ggplot2::aes(x = age, y = bmi))

# select specific percentiles to plot
gs_chart("weight_for_height", male = 0:1, p = c(0.10, 0.80))

Head Circumference for Age - Pediatric Growth Standard

Description

Head Circumference for age quantile, distribution, and zscore function based on LMS data from the CDC and WHO.

Usage

p_head_circumference_for_age(
  q,
  male,
  age,
  source = getOption("pedbp_pgs_source", "CDC"),
  ...
)

q_head_circumference_for_age(
  p,
  male,
  age,
  source = getOption("pedbp_pgs_source", "CDC"),
  ...
)

z_head_circumference_for_age(
  q,
  male,
  age,
  source = getOption("pedbp_pgs_source", "CDC"),
  ...
)

Arguments

q

a vector of quantiles

male

integer value, 1 = male, 0 = female

age

numeric age, in months

source

a character string denoting the data source providing the parameters needed for the estimate. Valid values are "CDC" and "WHO". This can be set explicitly, or by using the pedbp_pgs_source option.

...

pass through

p

a vector of probabilities

Value

p_ method return values from the estimated distribution function.

q_ methods return values from the estimated quantile function.

z_ methods return standard scores.

Notes

CDC Recommends using WHO growth charts for infants and children ages 0 to 2 years of age in the U.S. and CDC growth charts to monitor growth for children age 2 years and older in the U.S.

References

https://www.cdc.gov/growthcharts/percentile_data_files.htm, https://www.who.int/tools/child-growth-standards/standards

See Also

Examples

# The median head circumfernce for a two-year-old female:
q_head_circumference_for_age(p = 0.5, male = 0, age = 24, source = "CDC")

# Find the percentile for a 13 month old male with a head circumfernce of 46 cm:
p <- p_head_circumference_for_age(q = 46, male = 1, age = 13, source = "CDC")
p

# the standard score is the quantile from a standard normal
z_head_circumference_for_age(q = 46, male = 1, age = 13, source = "CDC")
qnorm(p)

# WHO not yet implimented
tryCatch(q_head_circumference_for_age(0.5, male = 0, age = 24, source = "WHO"),
         error = function(e) e)

Stature for Age - Pediatric Growth Standard

Description

Stature for age quantile, distribution, and zscore function based on LMS data from the CDC and WHO.

Usage

p_height_for_age(
  q,
  male,
  age,
  source = getOption("pedbp_pgs_source", "CDC"),
  ...
)

q_height_for_age(
  p,
  male,
  age,
  source = getOption("pedbp_pgs_source", "CDC"),
  ...
)

z_height_for_age(
  q,
  male,
  age,
  source = getOption("pedbp_pgs_source", "CDC"),
  ...
)

p_length_for_age(
  q,
  male,
  age,
  source = getOption("pedbp_pgs_source", "CDC"),
  ...
)

q_length_for_age(
  p,
  male,
  age,
  source = getOption("pedbp_pgs_source", "CDC"),
  ...
)

z_length_for_age(
  q,
  male,
  age,
  source = getOption("pedbp_pgs_source", "CDC"),
  ...
)

Arguments

q

a vector of quantiles

male

integer value, 1 = male, 0 = female

age

numeric age, in months

source

a character string denoting the data source providing the parameters needed for the estimate. Valid values are "CDC" and "WHO". This can be set explicitly, or by using the pedbp_pgs_source option.

...

pass through

p

a vector of probabilities

Value

p_ method return values from the estimated distribution function.

q_ methods return values from the estimated quantile function.

z_ methods return standard scores.

Notes

CDC Recommends using WHO growth charts for infants and children ages 0 to 2 years of age in the U.S. and CDC growth charts to monitor growth for children age 2 years and older in the U.S.

References

https://www.cdc.gov/growthcharts/percentile_data_files.htm, https://www.who.int/tools/child-growth-standards/standards

See Also

Examples

# Find the first quartile height for a 66 month old female.
# The quantile based on CDC data is slightly less than the quantile based on
# the data from the WHO
q_height_for_age(p = 0.25, age = 66, male = 0, source = c("CDC", "WHO"))

# The 90th quantile length/height for a 24 month female: note that these
# values are similar, but not identical
q_length_for_age(p = 0.9, age = 24, male = 0, source = c("CDC"))
q_height_for_age(p = 0.9, age = 24, male = 0, source = c("CDC"))

# Find the percentile for a 28 month old male with a stature (height/length)
# of 88 cm
p_height_for_age(q = 88, male = 1, age = 28, source = "CDC")
p_height_for_age(q = 88, male = 1, age = 28, source = "WHO")
p_length_for_age(q = 88, male = 1, age = 28, source = "CDC")
p_length_for_age(q = 88, male = 1, age = 28, source = "WHO")

# correseponding standard scores
z_height_for_age(q = 88, male = 1, age = 28, source = "CDC")
z_height_for_age(q = 88, male = 1, age = 28, source = "WHO")
z_length_for_age(q = 88, male = 1, age = 28, source = "CDC")
z_length_for_age(q = 88, male = 1, age = 28, source = "WHO")

Weight for Age - Pediatric Growth Standard

Description

Weight for age quantile, distribution, and zscore function based on LMS data from the CDC and WHO.

Usage

p_weight_for_age(
  q,
  male,
  age,
  source = getOption("pedbp_pgs_source", "CDC"),
  ...
)

q_weight_for_age(
  p,
  male,
  age,
  source = getOption("pedbp_pgs_source", "CDC"),
  ...
)

z_weight_for_age(
  q,
  male,
  age,
  source = getOption("pedbp_pgs_source", "CDC"),
  ...
)

Arguments

q

a vector of quantiles

male

integer value, 1 = male, 0 = female

age

numeric age, in months

source

a character string denoting the data source providing the parameters needed for the estimate. Valid values are "CDC" and "WHO". This can be set explicitly, or by using the pedbp_pgs_source option.

...

pass through

p

a vector of probabilities

Value

p_ method return values from the estimated distribution function.

q_ methods return values from the estimated quantile function.

z_ methods return standard scores.

Notes

CDC Recommends using WHO growth charts for infants and children ages 0 to 2 years of age in the U.S. and CDC growth charts to monitor growth for children age 2 years and older in the U.S.

References

https://www.cdc.gov/growthcharts/percentile_data_files.htm, https://www.who.int/tools/child-growth-standards/standards

See Also

Examples

# find the 80th quantile for 56 month old females;
# note - slight difference between CDC and WHO.
q_weight_for_age(p = 0.80, age = 56, male = 0, source = c("CDC", "WHO"))

# the percentiles for 42 kg 13 year old males:
p_weight_for_age(q = 42, age = 13 * 12, male = 0, source = "CDC")
p_weight_for_age(q = 42, age = 13 * 12, male = 0, source = "WHO")

z_weight_for_age(q = 42, age = 13 * 12, male = 0, source = "CDC")
z_weight_for_age(q = 42, age = 13 * 12, male = 0, source = "WHO")

Weight for Stature - Pediatric Growth Standard

Description

Weight for stature quantile, distribution, and zscore function based on LMS data from the CDC and WHO.

Usage

p_weight_for_height(
  q,
  male,
  height,
  source = getOption("pedbp_pgs_source", "CDC"),
  ...
)

q_weight_for_height(
  p,
  male,
  height,
  source = getOption("pedbp_pgs_source", "CDC"),
  ...
)

z_weight_for_height(
  q,
  male,
  height,
  source = getOption("pedbp_pgs_source", "CDC"),
  ...
)

p_weight_for_length(
  q,
  male,
  length,
  source = getOption("pedbp_pgs_source", "CDC"),
  ...
)

q_weight_for_length(
  p,
  male,
  length,
  source = getOption("pedbp_pgs_source", "CDC"),
  ...
)

z_weight_for_length(
  q,
  male,
  length,
  source = getOption("pedbp_pgs_source", "CDC"),
  ...
)

Arguments

q

a vector of quantiles

male

integer value, 1 = male, 0 = female

source

a character string denoting the data source providing the parameters needed for the estimate. Valid values are "CDC" and "WHO". This can be set explicitly, or by using the pedbp_pgs_source option.

...

pass through

p

a vector of probabilities

length, height

in centimeters

Details

Length or height values are used. Length is assess when the patient is lying down versus height when the patient is standing. There is an implication of younger patients being in the _for_length set. There is some overlap in numeric values of length and height.

Value

p_ method return values from the estimated distribution function.

q_ methods return values from the estimated quantile function.

z_ methods return standard scores.

Notes

CDC Recommends using WHO growth charts for infants and children ages 0 to 2 years of age in the U.S. and CDC growth charts to monitor growth for children age 2 years and older in the U.S.

References

https://www.cdc.gov/growthcharts/percentile_data_files.htm, https://www.who.int/tools/child-growth-standards/standards

See Also

Examples

# The 60th weight qualtile for a 1.2 meter tall male is
q_weight_for_height(p = 0.60, male = 1, height = 120, source = "CDC")
q_weight_for_height(p = 0.60, male = 1, height = 120, source = "WHO")

# There are slight differences in the quantiles for length and height
q_weight_for_length(p = 0.60, male = 1, length = 97, source = "CDC")
q_weight_for_height(p = 0.60, male = 1, height = 97, source = "CDC")

# percentiles and standard scores for a 14 kg, 88 cm tall/long male
p_weight_for_height(q = 14, male = 1, height = 88, source = "CDC")
p_weight_for_height(q = 14, male = 1, height = 88, source = "WHO")
p_weight_for_length(q = 14, male = 1, length = 88, source = "CDC")
p_weight_for_length(q = 14, male = 1, length = 88, source = "WHO")

# correseponding standard scores
z_weight_for_height(q = 14, male = 1, height = 88, source = "CDC")
z_weight_for_height(q = 14, male = 1, height = 88, source = "WHO")
z_weight_for_length(q = 14, male = 1, length = 88, source = "CDC")
z_weight_for_length(q = 14, male = 1, length = 88, source = "WHO")