Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obtained percentiles are wrong for source=flynn2017 #22

Open
wenlunyuan opened this issue May 15, 2024 · 7 comments
Open

Obtained percentiles are wrong for source=flynn2017 #22

wenlunyuan opened this issue May 15, 2024 · 7 comments

Comments

@wenlunyuan
Copy link

Dear author,
I have been using a SAS macro to derive Flynn et al 2017 blood pressure percentiles. I compared the results obtained with your package after changing the source of data (to flynn2017) but I did not obtain the same percentiles.
I have checked for a child of a certain height, sex, age, sbp and dbp, the percentiles obtained from SAS macro and it was consistent with what is expected in Flynn et al 2017 percentiles table. However, using your package, the percentile obtained didn't fit the percentiles from Flynn et al table.
Could u check your package to provide a correction?
Best regards
Thanks

@dewittpe
Copy link
Owner

Hi @wenlunyuan

Thank you for the note. The behavior you describe is expected behavior and is documented on the package website:
https://www.peteredewitt.com/pedbp/articles/bp-distributions_ARTICLE.html#comparing-to-published-percentiles

The percentiles published in Expert Panel on Integrated Guidelines for Cardiovascular Health and Risk Reduction in Children and Adolescents (2011) and Flynn et al. (2017) where used to estimate a Gaussian mean and standard deviation. This was in part to be consistent with the values from Gemelli et al. (1990) and Lo et al. (2013). As a result, the calculated percentiles and quantiles from the pedbp package for Expert Panel on Integrated Guidelines for Cardiovascular Health and Risk Reduction in Children and Adolescents (2011) and Flynn et al. (2017) will be slightly different from the published values.

The estimated value from the pedbp package are within 2 points of the published percentiles, and the quantiles are within 2mmHg from the published.

If you have found anything out side of that range please let me know! I would also be interested to know how the results between the the SAS macro and the pedbp compare overall, not just on at the published values.

@wenlunyuan
Copy link
Author

wenlunyuan commented May 16, 2024 via email

@dewittpe
Copy link
Owner

I'm curious what the inputs were that you used.

for a boy aged 6y, having height=116, sbp=95.5 and dbp=56, I got sbp pct=53 and dbp pct=51 with the SAS macro.

Using your package, I got pct=69 and dbp pct=69.

I get sbp percentile = 61 and dbp percentile = 59

library(pedbp)
packageVersion("pedbp")
#> [1] '2.0.0'

p_bp(q_sbp = 95.5, # mmHG
     q_dbp = 56.0, # mmHg
     age   = 6 * 12, # 6 years = 72 months
     male  = 1,
     height = 116, # cm
     source = "flynn2017")
#> $sbp_p
#> [1] 0.6061342
#> 
#> $dbp_p
#> [1] 0.5852371

for a boy aged 6y , having height=111, sbp=107 and dbp=64, I got sbp pct=93 and dbp pct=84 with the SAS macro vs 94 and 89 with your package.

I get sbp percentile 93 and dbp percentile 86

p_bp(q_sbp = 107,
     q_dbp = 64,
     age   = 6 * 12, # 6 years = 72 months
     male  = 1,
     height = 111,
     source = "flynn2017")
#> $sbp_p
#> [1] 0.9344853
#> 
#> $dbp_p
#> [1] 0.8595886

@wenlunyuan
Copy link
Author

wenlunyuan commented May 17, 2024 via email

@dewittpe
Copy link
Owner

I get the same results you get:

library(pedbp)
packageVersion("pedbp")
#> [1] '2.0.0'
x <- p_bp(q_sbp = 95.5, q_dbp = 56.0, male=1,age=71, height=115.85, source="flynn2017")
x
#> $sbp_p
#> [1] 0.6825551
#> 
#> $dbp_p
#> [1] 0.7050552

The mean and sd used for the estiamtes are based on a look up table and will
use the values for the the age

attr(x, "bp_params")
#>      source male age sbp_mean   sbp_sd dbp_mean   dbp_sd height_percentile
#> 1 flynn2017    1  60  90.9921 9.493194 51.00446 9.268235                 5

In this case it is for age = 60 months. We should get the same results for
any age in the interval [60, 72) given all other inputs are static.

x <- p_bp(q_sbp = 95.5, q_dbp = 56.0, male=1,age=seq(60, 71.9, by = 0.1), height=115.85, source="flynn2017")
str(x)
#> List of 2
#>  $ sbp_p: num [1:120] 0.683 0.683 0.683 0.683 0.683 ...
#>  $ dbp_p: num [1:120] 0.705 0.705 0.705 0.705 0.705 ...
#>  - attr(*, "bp_params")='data.frame':    120 obs. of  8 variables:
#>   ..$ source           : chr [1:120] "flynn2017" "flynn2017" "flynn2017" "flynn2017" ...
#>   ..$ male             : int [1:120] 1 1 1 1 1 1 1 1 1 1 ...
#>   ..$ age              : num [1:120] 60 60 60 60 60 60 60 60 60 60 ...
#>   ..$ sbp_mean         : num [1:120] 91 91 91 91 91 ...
#>   ..$ sbp_sd           : num [1:120] 9.49 9.49 9.49 9.49 9.49 ...
#>   ..$ dbp_mean         : num [1:120] 51 51 51 51 51 ...
#>   ..$ dbp_sd           : num [1:120] 9.27 9.27 9.27 9.27 9.27 ...
#>   ..$ height_percentile: num [1:120] 5 5 5 5 5 5 5 5 5 5 ...
#>  - attr(*, "class")= chr [1:2] "pedbp_bp" "pedbp_p_bp"
unique(x$sbp_p)
#> [1] 0.6825551
unique(x$dbp_p)
#> [1] 0.7050552

I am guessing that the SAS macro is using some form of interpolation.

I’ve been considering developing and extending the pedbp methods to use
interpolations, but that has not yet been done.

Created on 2024-05-22 with reprex v2.1.0

@wenlunyuan
Copy link
Author

wenlunyuan commented May 23, 2024 via email

@dewittpe
Copy link
Owner

@wenlunyuan - I recently had another user report a similar issue and I found and fixed an error in the code. Would you mind trying the dev version 2.0.2.9000 (commit dd02d8c) to see if the results between pedbp and the SAS macro as closer? I still expect them to be different, but the delta might be smaller. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants