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

Brittany/post processing quantiles #73

Merged
merged 2 commits into from
Aug 12, 2022

Conversation

BHagedorn-IDM
Copy link
Collaborator

Two updates:

Added quantile calculations to the post-processing summaries to extend the analyses that are possible.
Corrected the age bins to not be overlapping.

@BHagedorn-IDM BHagedorn-IDM requested a review from MeWu-IDM August 11, 2022 22:06
Copy link
Collaborator

@MeWu-IDM MeWu-IDM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This chaneg looks ok to me, just add some thoughts about the code below.
FYI if you need to build a new release with zip file in it, you will need to change version in DESCRIPTION (not necessary if you just work off main branch for now)

.(
CI05 = quantile(TotHrs, probs = c(.05)),
CI25 = quantile(TotHrs, probs = c(.25)),
MeanHrs = mean(TotHrs),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems CI50 and MeanHrs are the same thing? just curios as they are both used

@@ -255,35 +255,35 @@ TaskTimesGroup <- function(taskIDs, years, weeksPerYear = 48){
if (label == "adults 31-44") {
return(sum(pop$Female[32:45] + pop$Male[32:45]))
}
if (label == "women 20-30") {
Copy link
Collaborator

@MeWu-IDM MeWu-IDM Aug 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to use case-switch logic which may be easier to maintain also generally faster than if-else
examples like this
image
@celiot-IDM what do you think

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a sensible suggestion, but I'm going to suggest that what we really want is to somehow make population range labels configurable from the input spreadsheet. This would reduce the number of common maintenance tasks that require coding.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PS I also hate the look of a long line of if-statements, but it's super-easy to understand, and once I realized this was the part of the code most likely to be edited by researchers, I opted for the less elegant (but easy to understand) approach over the more compact switch-statement.

But as I mention in the previous comment, I don't think either approach is best.

@celiot-IDM celiot-IDM merged commit a7eefa6 into main Aug 12, 2022
@rhanIDM rhanIDM deleted the brittany/post-processing-quantiles branch September 21, 2022 20:31
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

Successfully merging this pull request may close these issues.

3 participants