-
Notifications
You must be signed in to change notification settings - Fork 3
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
Closes #55 Percentiles for age were being miscalculated #56
Closes #55 Percentiles for age were being miscalculated #56
Conversation
R/derive_params_growth_age.R
Outdated
@@ -283,6 +283,10 @@ derive_params_growth_age <- function(dataset, | |||
) %>% | |||
select(-c(P95, Sigma)) | |||
} | |||
else { | |||
add_pctl <- add_pctl %>% | |||
mutate(AVAL = pnorm(AVAL)*100) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rossfarrugia I originally had the code set up was
- calculate z-score
- use pnorm to calculated percentile
- if bmi correction, use AVAL to recalculated appropriate percentile (this is incorrect cuz aval is currently already in percentile form , need the value for 1)
so I modified it to
- get z-score
- calculate bmi correction for percentile if thats being requested, if not skip this step
- !!! forgot to still calculate the percentile (This is what the code is now doing)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that said, the numbers for percentile are finally looking correct again, I was so focused on checking that the bmi correction was doing done properly I forgot to check that it was running normally again
@rossfarrugia Just to point it out, the patient with abnormally low head circumference even a sanity check with the WHO excel makes sense too, data prior to their "428 days old" ~14 month old visit, you see their HC from the 359-407 visits is well below 40, as we can see on the WHO's HC for age chart, even the P01 percentile indicates for that age ~12-13 months old, the P01 percentile is 40.7-41 |
@Fanny-Gautier @Lina2689 would you have chance to sanity check this update and test run it with your template to see all looks good? |
I'll try to find some times tomorrow. thanks |
@zdz2101 does this PR resolve the following issue @Minlei0201 sent by email? During the testing, I noticed the |
I think so, I can see the following difference: |
Yes the pctl's should all be correctly calculated here now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double checked and the PCTLs properly implemented now
…-charts-if-bmi_correction-is-set-to-false
Thank you for your Pull Request! We have developed this task checklist from the Development Process Guide to help with the final steps of the process. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the admiral codebase remains robust and consistent.
Please check off each taskbox as an acknowledgment that you completed the task or check off that it is not relevant to your Pull Request. This checklist is part of the Github Action workflows and the Pull Request will not be merged into the
main
branch until you have checked off each task.styler::style_file()
to style R and Rmd filesdevtools::document()
so all.Rd
files in theman
folder and theNAMESPACE
file in the project root are updated appropriatelyNEWS.md
under the header# admiralpeds (development version)
if the changes pertain to a user-facing function (i.e. it has an@export
tag) or documentation aimed at users (rather than developers)pkgdown::build_site()
and check that all affected examples are displayed correctly and that all new functions occur on the Reference page.lintr::lint_package()
R CMD check
locally and address all errors and warnings -devtools::check()