Gilead-BioStats / gsm

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

Feature: Support optional filter expressions in `Input_Rate()` #1784

Closed jwildfire closed 2 months ago

jwildfire commented 2 months ago

Feature Details

Optionally allow users to provide expressions that will filter the input data frames (dfSubject, dfNumerator, dfDenominator) in input_rate().

The yaml version of the SAE KRI might become something like:

- name: Input_Rate
    output: Analysis_Input
    params:
      dfSubjects: Mapped_DM # was Mapped_Enrolled
      dfNumerator: Mapped_AE # was Mapped_SAE
      dfDenominator: Mapped_DM # previously Mapped_Enrolled
      expFilterSubjects: enrollyn == 'Y'
      expFilterNumerator: aeser == 'Y'
      expFilterDenominator: enrollyn == 'Y'
      strSubjectCol: subjid
      strGroupCol: country
      strGroupLevel: GroupLevel
      strNumeratorMethod: Count
      strDenominatorMethod: Sum
      strDenominatorCol: timeonstudy

This should reduce the number of needed data domains in the Mapped data.

Example Code

Possible Implementation

Additional Comments

jwildfire commented 2 months ago

Implementation is related to the recently closed #1782

jwildfire commented 2 months ago

Here's what I think the data map will look like using this new functionality. This is showing how the "Mapped" data layer is passed to input_rate() for each of our 12 standard KRI.

image

lauramaxwell commented 2 months ago

No longer needed- see discussion in #1798