FDA Table 08
All Individual Patient Deaths, Safety Population, Pooled Analyses
table
FDA
safety
adverse events
Code
# Load libraries & data -------------------------------------
library(dplyr)
library(cards)
library(gtsummary)
adae <- pharmaverseadam::adae
adex <- pharmaverseadam::adex
# Pre-processing --------------------------------------------
# deaths
adae <- adae |>
filter(
# safety population
SAFFL == "Y",
# deaths
DTHFL == "Y"
) |>
# select variables from `adae` to include in final result
select(USUBJID, TRT01A, AGE, SEX, DTHADY, DTHCAUS) |>
# derive formatted "Age/Gender" column values
mutate(
AGE_SEX = paste(AGE, SEX, sep = "/")
) |>
# keep one row per unique ID
distinct(USUBJID, DTHCAUS, DTHADY, .keep_all = TRUE)
# dosing
adex <- adex |>
filter(
# safety population
SAFFL == "Y",
# total dosages
PARAMCD == "TDOSE"
) |>
# select variables from `adex` to include in final result
select(USUBJID, AVAL, TRTSDT, TRTEDT) |>
mutate(
# derive dosage duration
DOSDUR = (TRTEDT - TRTSDT + 1) |> as.character(),
# format dosage values
DOSAGE = paste0(AVAL, " mg")
)
# combine all data
data <- left_join(adae, adex, by = "USUBJID") |>
select(TRT01A, USUBJID, AGE_SEX, DOSAGE, DOSDUR, DTHADY, DTHCAUS) |>
arrange()
Code
tbl <- as_gtsummary(data) |>
# set table header labels
modify_header(
TRT01A = "**Study Arm**",
USUBJID = "**Patient ID**",
AGE_SEX = "**Age/** \n **Gender**",
DOSAGE = "**Dosage**",
DOSDUR = "**Dosing** \n **Duration** \n **(Days)**",
DTHADY = "**Study** \n **Day of** \n **Death**",
DTHCAUS = "**Cause of Death**"
) |>
# align all columns left
modify_column_alignment(everything(), align = "left")
tbl
# A tibble: 3 × 7
TRT01A USUBJID AGE_SEX DOSAGE DOSDUR DTHADY DTHCAUS
<chr> <chr> <chr> <chr> <chr> <dbl> <chr>
1 Xanomeline Low Dose 01-701-1211 76/F 3186 mg 59 61 SUDDEN DEATH
2 Placebo 01-704-1445 75/M 0 mg 175 175 COMPLETED SUICIDE
3 Placebo 01-710-1083 89/F 0 mg 11 12 MYOCARDIAL INFARCTION