Skip to content

Bug of format_ae_listing #123

@LittleBeannie

Description

@LittleBeannie

It seems that in formate_ae_listing, some columns are must-to-have, including but not limited to RACE, AGE, ect. If these variables are not selected, the code gives errors.

Following is a minimal sufficient example:

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") |>
  # ----------------------------------------- #
  # 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()

metalite.ae::prepare_ae_specific(meta, 
                                 population ="apat", observation ="apat", 
                                 parameter = "any-AE", components = "soc", reference_group = NULL) |>
  metalite.ae::extend_ae_specific_inference() |>
  forestly:::collect_ae_listing(display = c("USUBJID", "SEX")) |>
  forestly:::format_ae_forestly() 

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