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

Pop-workflow: Improve default binning for plotPK/plotDemography #383

Closed
Yuri05 opened this issue Nov 17, 2020 · 6 comments
Closed

Pop-workflow: Improve default binning for plotPK/plotDemography #383

Yuri05 opened this issue Nov 17, 2020 · 6 comments

Comments

@Yuri05
Copy link
Member

Yuri05 commented Nov 17, 2020

In the attached example 4 populations with 500 individuals each were defined: reference adult population for [30 .. 70] years and 3 children populations for [0 .. 3], [3 .. 6], [6 .. 9] years.
All the age-dependency plots in PK/Demography show nothing for [0 ..3] and [0..6] populations and only very few bins for [6 ..9].

01_bin.zip

Expand to see the plots

The default binning algorithm should be improved so that every Range plot shows at least N bins per default.
(not sure what the good choice for N is. 10?)

@Yuri05
Copy link
Member Author

Yuri05 commented Nov 17, 2020

@pchelle @abdullahhamadeh Same reason as in #318. I have also tried to set the bins manually as described in #318 - but did not manage to get any bins for child populations. Can you tell me hot to set the bins properly for the example attached if I want to have e.g. 10 bins in every range plot?

@pchelle
Copy link
Collaborator

pchelle commented Nov 17, 2020

Currently, binning manually 10 bins per population would give:
workflow$plotPKParameters$settings$xParametersBreaks[[StandardPath$Age]] <- unique(c(seq(0, 3, length.out=10), seq(3, 6, length.out=10), seq(6, 9, length.out=10), seq(30, 70, length.out=10)))

@pchelle
Copy link
Collaborator

pchelle commented Nov 17, 2020

I went back into the code to see if I could find a solution,
currently the binning happens here:

aggregatedData <- getDemographyAggregatedData(

but I could make it happen after the selection of the population: e.g.

comparisonData <- aggregatedData[aggregatedData$Population %in% populationName, ]

In which case, settings$xParametersBreaks can be renamed settings$bins for clarity.
And can become a 2-levels list (one level for the x parameter = StandardPath$Age, and one for the simulationSetName = "Kids 0-3 years") or an R6 object
Thoughts ?

pchelle added a commit to pchelle/OSPSuite.ReportingEngine that referenced this issue Nov 19, 2020
…nSet selection

The binning method is now centralized for all the demography parameters
@pchelle
Copy link
Collaborator

pchelle commented Nov 19, 2020

With the update of PR #387, the aggregation is now performed after the selection of the population.
Consequently, the default binning is performed by population and look much better (see example below).

Kids 0-3 years-vs-ref-C_max-vs-Age

@pchelle
Copy link
Collaborator

pchelle commented Nov 19, 2020

Moving forward, the setting of the bins will also be easier:
workflow$plotPKParameters$settings$bins <- 15 and
workflow$plotDemography$settings$bins <- 15

I also added from our discussion the setting for stairstep plot:
workflow$plotDemography$settings$stairstep <- TRUE to have stairstep plot (which is default)
workflow$plotDemography$settings$stairstep <- FALSE to link the aggregated values

@Yuri05
Copy link
Member Author

Yuri05 commented Nov 19, 2020

really nice!

@Yuri05 Yuri05 closed this as completed in ffefd32 Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants