RXR 2396: update pct_weight_for_age() and related functions#66
RXR 2396: update pct_weight_for_age() and related functions#66mccarthy-m-g merged 18 commits intomasterfrom
pct_weight_for_age() and related functions#66Conversation
|
Looks good, playing around wit a bit. In principle changes to UI are fine with me. One benefit though of the old version is that you can also request the median weight for a However, in the new implementation this doesn't seem possible (you have to supply a dummy value and it cannot be NA either), which is a bit counterintuitive: Can we make the Also, it seems the |
Sure, that's fine too, even better. I think it's important to have that feature easily accessible.
I see. It's still a bit counterintuitive to me. Because if I only pass one value (a common use case), the output is just a single value while with |
|
Renamed the |
roninsightrx
left a comment
There was a problem hiding this comment.
looks good. Few final comments:
- we can also remove the old data (in
inst), no? - one q about not exporting a helper function.
Yeah, I don't think we need it anymore. If we do this, do we also want to remove the |
jasmineirx
left a comment
There was a problem hiding this comment.
lgtm, very minor documentation suggestions only

This PR is a first attempt at updating the
pct_weight_for_age()and related functions. We use these functions in production code internally, so I've opted to add newpct_weight_for_age_v()(v for vectorized) functions rather than refactor the old ones, since the new versions would lead to breaking changes. Main changes in this PR:pct_*_for_*_v()functions. The reason we want vectorized versions of these functions is for data cleaning; you can now use these in adplyr::mutate()call to get make a new column of percentiles for each observation.We should discuss whether to keep these as new/separate functions, or to introduce breaking changes to the old ones. If we do want to keep them separate, I can still update the old ones to work with the new CDC data/equations.
Here's some example output for the main functionality: