Skip to content

AE listing does not work when view by SOC #105

@LittleBeannie

Description

@LittleBeannie

The following code generates two AE tables: one for any AE and another for drug-related AEs.

Unlike the usual AE forest plot (which is grouped by PT), this version is grouped by SOC. That’s why we specify var = "AEBODSYS", soc = "AEBODSYS" in define_parameter().

The current issue is that when switching to the SOC view, the AE listing drill-down does not work.

adsl <- forestly_adsl
adae <- forestly_adae

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

meta <- meta_adam(population = adsl, observation = adae) |>
  define_plan(plan = plan(
    analysis = "ae_forestly",
    population = "apat",
    observation = "apat",
    parameter = "any;drug-related"
  )) |>
  define_analysis(name = "ae_forestly", label = "Interactive Forest Plot") |>
  define_population(
    name = "apat", group = "TRTA", id = "USUBJID",
    subset = SAFFL == "Y", label = "All Patient as Treated"
  ) |>
  define_observation(
    name = "apat", group = "TRTA",
    subset = SAFFL == "Y", label = "All Patient as Treated"
  ) |>
  define_parameter(
    name = "any",
    subset = NULL,
    label = "SOC accociated with Any AEs",
    var = "AEBODSYS", soc = "AEBODSYS",
    term1 = "any",
    term2 = ""
  ) |>
  define_parameter(
    name = "drug-related",
    subset = toupper(AREL) == "RELATED",
    label = "SOC accociated with Drug-related AEs",
    var = "AEBODSYS", soc = "AEBODSYS",
    term1 = "drug-related",
    term2 = ""
  ) |>
  meta_build()

meta |>
  prepare_ae_forestly() |>
  format_ae_forestly(display = c("n", "prop", "fig_prop", "fig_diff", "total")) |>
  ae_forestly()
Image

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