bp_distribution {pedbp} | R Documentation |
Percentile and quantile functions for pediatric blood pressure.
p_bp(q_sbp, q_dbp, age, male, height = NA, height_percentile = 0.5, ...)
q_bp(p_sbp, p_dbp, age, male, height = NA, height_percentile = 0.5, ...)
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. |
height_percentile |
default height percentile to use if |
... |
not currently used |
p_sbp |
a vector of systolic blood percentiles |
p_dbp |
a vector of diastolic blood percentiles |
a pedbp_bp
object. This is a list of two numeric vectors:
sbp_percentile
(systolic blood pressure) and dbp_percentile
(diastolic blood pressure). Additionally, the bp_params
attribute
provides details on the data source and parameters used in the percentile
estimates.
vignette("bp-distriution", package = "pedbp")
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
q_bp(
p_sbp = bp_percentiles$sbp_percentile
, p_dbp = bp_percentiles$dbp_percentile
, age = d$age_months
, male = d$male
)