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")
Run the code above in your browser using DataLab