Skip to content

Bug of prepare_ae_forestly #124

@LittleBeannie

Description

@LittleBeannie
adsl <- forestly_adsl
adae <- forestly_adae
adsl$TRTA <- factor(adsl$TRTA, levels = c("Placebo", "Xanomeline Low Dose"))
adae$TRTA <- factor(adae$TRTA, levels = c("Placebo", "Xanomeline Low Dose"))


meta <- meta_adam(population = adsl, observation = adae) |>
  define_plan(plan = plan(analysis = "ae_forest_plot",
                          population = "apat",
                          observation = "apat",
                          parameter = "any-AE"           
  )) |>
  # ----------------------------------------- #
  # define populations
  # ----------------------------------------- #
  define_population(name = "apat",
                    group = "TRTA",
                    subset = SAFFL == "Y" ,
                    label = "All Participants as Treated Population",
                    var = c("USUBJID", "TRTA", "RACE", "SEX", "AGE", "AGEU")) |>
  # ----------------------------------------- #
  # define observations
  # ----------------------------------------- #
  define_observation(name = "apat",
                     group = "TRTA",
                     subset = SAFFL == "Y" ,
                     label = "All Participants as Treated Population") |>
  # ----------------------------------------- #
  # define analysis like 1 row in A&R grid
  # ----------------------------------------- #
  define_analysis(name = "ae_forest_plot",
                  label = "Interactive AE Forest Plot") |>
  # ----------------------------------------- #
  # parameters for AE analysis    
  # ----------------------------------------- #
  # Any AEs
  define_parameter(name = "any-AE",
                   subset = SAFFL == "Y",
                   label = "Any AEs",
                   var = "AEDECOD", soc = "AEBODSYS", term1 = "", term2 = "") |>
  meta_build()

meta |> prepare_ae_forestly(population = "apat", observation = "apat", ae_listing_display = c("USUBJID", "RACE", "SEX", "AEG", "AEGU"))

The root cause is that, "AGEU" is a variable in adsl, while it doesn't exist in adae.

After fixing the bug, please also improve the following:

  • The default of var = ... in define_population should be NULL, where users MUST provides a list of variables
  • The default of var = ... in define_observation should be NULL, where users MUST provides a list of variables

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions