Gilead-BioStats / gsm

Good Statistical Monitoring R Package
https://gilead-biostats.github.io/gsm/
Apache License 2.0
36 stars 9 forks source link

Bugfix: `MakeBounds()` assumes `NormalApprox` method #1684

Closed lauramaxwell closed 1 month ago

lauramaxwell commented 1 month ago

Expected Behavior

User should be able to control method for all steps used in their pipeline

Current Behavior

MakeBounds hard codes Analyze_NormalApprox_PredictBounds() into the function, so poisson method cannot be used to calculate dfBounds

Possible Solution

Either we

  1. add an argument in MakeBounds() to specify method and edit code to switch function based on this argument. this can be taken from workflow$meta/dfMetrics Model param in workflows.
  2. get rid of other methods, since we are only using NormalApprox in all examples

choice 1 is probably optimal, but wanted to make sure we still wanted to keep the other methods in general...

Steps to Reproduce

1. 4. 5. 6.

Context (Environment)

Possible Implementation

Additional Comments

Also need to add Type to reportingMetrics

jwildfire commented 1 month ago

Good call. Let's use dfMetrics$Type to pick the appropriate function instead of adding a new parameter

lauramaxwell commented 1 month ago

@jwildfire ok, so if Type %in% c("binary", "rate") then we use Analyze_NormalApprox_PredictBounds else if Type == "poisson" we use Analyze_Poisson_PredictBounds and any other value of Type we don't produce bounds since the other methods don't have a PredictBounds function?