dewittpe / pedbp

R package for working with pediatric blood pressures based on age and height
http://www.peteredewitt.com/pedbp/
6 stars 0 forks source link

Default height_percentile not used as expected #6

Closed dewittpe closed 10 months ago

dewittpe commented 10 months ago

Expect the second and first call to p_bp to give the same result. Likely issue is in the logic for use of the height percentile when height is NA

> ht <- q_stature_for_age(p = 0.90, age = 44, male = 1)
> ht
[1] 105.2123
> p_bp(q_sbp = 100, q_dbp = 60, age = 44, male = 1, height = ht)
$sbp_percentile
[1] 0.7086071

$dbp_percentile
[1] 0.8485735

> p_bp(q_sbp = 100, q_dbp = 60, age = 44, male = 1, height_percentile = 0.9)
$sbp_percentile
[1] 0.7700861

$dbp_percentile
[1] 0.72739

> p_bp(q_sbp = 100, q_dbp = 60, age = 44, male = 1, height_percentile = 0.5)
$sbp_percentile
[1] 0.7700861

$dbp_percentile
[1] 0.72739
dewittpe commented 10 months ago

Nevermind, this is expected. Both calls use Lo et.al. data where height is not needed, at all. If age was < 36 months then there would be a difference based on the height_percentile