Create a Interactive Table for Adverse Events Analysis for Clinical Trials

Authors
Affiliation

Benjamin Wang

Merck & Co., Inc.

Yujie Zhao

Merck & Co., Inc.

Background

Forest plot is an efficient visualization tool in clinical trial analysis & reporting to explore treatment effect in different sub-groups. Forest plot is usually delivered as a static report. To improve the user experience, we propose an R package, forestly, that can generate interactive forest plots. In this post we will share details of this R package and its several interactive features including filtering adverse event (AE) category of interest, drilling down to the subject-level details, and additional interactive features to reveal more information. We also highlights search bars and slide bars that are embedded for users to quickly find AE of interest within a desirable incidence range.

library(forestly)

Input dataset

forestly uses datasets compliant with ADaM, which is one of the standards required for submission of clinical trial analysis data to U.S and Japanese regulatory agencies.

Subject-level ADaM Dataset Example

      USUBJID SITEID SEX  RACE AGE SAFFL                TRTA
1 01-701-1015    701   F WHITE  63     Y             Placebo
2 01-701-1023    701   M WHITE  64     Y             Placebo
4 01-701-1033    701   M WHITE  74     Y Xanomeline Low Dose
6 01-701-1047    701   F WHITE  85     Y             Placebo
7 01-701-1097    701   M WHITE  68     Y Xanomeline Low Dose
8 01-701-1111    701   F WHITE  81     Y Xanomeline Low Dose

ADaM Dataset for Adverse Event Example

      USUBJID    AESEV AESER    AEREL AEACN                      AEOUT ASTDY
1 01-701-1015     MILD     N PROBABLE       NOT RECOVERED/NOT RESOLVED     2
2 01-701-1015     MILD     N PROBABLE       NOT RECOVERED/NOT RESOLVED     2
3 01-701-1015     MILD     N   REMOTE               RECOVERED/RESOLVED     8
4 01-701-1023     MILD     N POSSIBLE       NOT RECOVERED/NOT RESOLVED     3
5 01-701-1023 MODERATE     N PROBABLE       NOT RECOVERED/NOT RESOLVED     3
6 01-701-1023     MILD     N POSSIBLE       NOT RECOVERED/NOT RESOLVED    22
  ADURN ADURU    TRTA
1    NA       Placebo
2    NA       Placebo
3     3   DAY Placebo
4    24   DAY Placebo
5    NA       Placebo
6    NA       Placebo

Basic Example

forestly has 4 functions to create input metadata, generate statistics, customize output layout and generate interactive forest plot.

  • meta_forestly(): construct input metadata for AE analysis from ADaM datasets. Typically, ADSL and ADAE.
  • prepare_ae_forestly(): prepare datasets for interactive forest plot.
  • format_ae_forestly(): format output layout using parameters defined in forestly:: prepare_ae_forestly() for interactive forest plot.
  • ae_forestly(): generate and display interactive forest plot.
meta_forestly(
  dataset_adsl = forestly_adsl,
  dataset_adae = forestly_adae,
  population_term = "apat",
  observation_term = "wk12",
  parameter_term = "any;rel;ser"
) |>
  prepare_ae_forestly() |>
  format_ae_forestly() |>
  ae_forestly()
Warning in metalite.ae::prepare_ae_specific(meta, population = population, : In
observation level data, force group variable 'TRTA' be a factor

Warning in metalite.ae::prepare_ae_specific(meta, population = population, : In
observation level data, force group variable 'TRTA' be a factor

Warning in metalite.ae::prepare_ae_specific(meta, population = population, : In
observation level data, force group variable 'TRTA' be a factor

There are several interactive features to help enhance user experience

  • Category of AE can be selected to filter (i) any AE (ii) drug-related AEs (iii) serious AEs

  • Filtered based on AE Incidence

  • Labels can be revealed by hovering the mouse over a point and error bar

  • Sorting is enabled by clicking column header

  • Search bar for users to quickly perform global “keyword” search

  • Source data can be downloaded as CSV file for additional analysis as needed

  • Subject level information can be drilled down by clicking ▶

  • Pagination applied to navigate to different pages quickly

Customize Layout

The forestly also enables users to customize the layout of the table. Here are some examples to illustrate this.

Display different table panel:

outdata <- meta_forestly(
  dataset_adsl = forestly_adsl_3grp,
  dataset_adae = forestly_adae_3grp,
  population_term = "apat",
  observation_term = "wk12",
  parameter_term = "any;rel;ser"
) 

By using the display argument in format_ae_forestly(), we can choose to display the total column or risk difference column.

outdata |>
  prepare_ae_forestly() |>
  format_ae_forestly(display = c("n", "prop", "fig_diff", "diff", "total")) |>
  ae_forestly()

Display different subject-level variables for drill-down table

Users can explore more detailed information of patients by clicking ▶ of each row.The parameter ae_listing_display has definition of what columns are displayed.

listing_var <- c(
   "SITEID", "SEX", "RACE", "AGE", "ASTDY", "AESER", "ASTDT", "AENDT"
)

outdata |>
  prepare_ae_forestly(ae_listing_display = listing_var) |>
  format_ae_forestly(color = c("black", "grey60", "grey40")) |> # Define different colors from the default value
  ae_forestly()