cardinal
  • Home
  • Template Library
    • FDA Table 2
    • FDA Table 3
    • FDA Table 4
    • FDA Table 5
    • FDA Table 6
    • FDA Table 7
    • FDA Table 8
    • FDA Table 9
    • FDA Table 10
    • FDA Table 11
    • FDA Table 12
    • FDA Table 13
    • FDA Table 14
    • FDA Table 15
    • FDA Table 16
    • FDA Table 17
    • FDA Table 18
    • FDA Table 20
    • FDA Table 21
    • FDA Table 22
    • FDA Table 32
    • FDA Table 33
    • FDA Table 34
    • FDA Table 35
    • FDA Table 36
    • FDA Figure 1
    • FDA Figure 2
    • FDA Figure 3
    • FDA Figure 14
  • About
  • Resources
  • Help
    • Getting Started
    • Report a Bug
    • FAQ

FDA Table 38

Patients With Adverse Events by System Organ Class, FDA Medical Query (Broad) and Preferred Term, Safety Population, Pooled Analysis (or Trial X)

  • Spec. Screenshot
  • rtables Table
  • rtables Table Setup
  • Function Details

Body System or Organ Class                                                                           
  FMQ (Broad)                 A: Drug X    B: Placebo   C: Combination   Risk Difference (%) (95% CI)
    Dictionary-Derived Term    (N=134)      (N=134)        (N=132)                 (N=268)           
—————————————————————————————————————————————————————————————————————————————————————————————————————
cl A.1                                                                                               
  FMQ1                        32 (23.9%)   29 (21.6%)     48 (36.4%)          -2.2 (-12.3 - 7.8)     
    dcd A.1.1.1.1             17 (12.7%)   13 (9.7%)      29 (22.0%)          -3.0 (-10.5 - 4.6)     
    dcd A.1.1.1.2             20 (14.9%)   20 (14.9%)     26 (19.7%)           0.0 (-8.5 - 8.5)      
  FMQ2                        35 (26.1%)   40 (29.9%)     39 (29.5%)          3.7 (-7.0 - 14.5)      
    dcd A.1.1.1.1             24 (17.9%)   25 (18.7%)     30 (22.7%)          0.7 (-8.5 - 10.0)      
    dcd A.1.1.1.2             18 (13.4%)   18 (13.4%)     13 (9.8%)            0.0 (-8.2 - 8.2)      
  FMQ3                        37 (27.6%)   39 (29.1%)     38 (28.8%)          1.5 (-9.3 - 12.3)      
    dcd A.1.1.1.1             19 (14.2%)   18 (13.4%)     21 (15.9%)          -0.7 (-9.0 - 7.5)      
    dcd A.1.1.1.2             21 (15.7%)   23 (17.2%)     23 (17.4%)          1.5 (-7.4 - 10.4)      
cl B.1                                                                                               
  FMQ1                        19 (14.2%)   21 (15.7%)     21 (15.9%)          1.5 (-7.0 - 10.0)      
    dcd B.1.1.1.1             19 (14.2%)   21 (15.7%)     21 (15.9%)          1.5 (-7.0 - 10.0)      
  FMQ2                        14 (10.4%)   21 (15.7%)     24 (18.2%)          5.2 (-2.8 - 13.3)      
    dcd B.1.1.1.1             14 (10.4%)   21 (15.7%)     24 (18.2%)          5.2 (-2.8 - 13.3)      
  FMQ3                        21 (15.7%)   16 (11.9%)     10 (7.6%)           -3.7 (-12.0 - 4.5)     
    dcd B.1.1.1.1             21 (15.7%)   16 (11.9%)     10 (7.6%)           -3.7 (-12.0 - 4.5)     
cl B.2                                                                                               
  FMQ1                        40 (29.9%)   34 (25.4%)     39 (29.5%)          -4.5 (-15.2 - 6.2)     
    dcd B.2.1.2.1             22 (16.4%)   22 (16.4%)     20 (15.2%)           0.0 (-8.9 - 8.9)      
    dcd B.2.2.3.1             20 (14.9%)   17 (12.7%)     22 (16.7%)          -2.2 (-10.5 - 6.0)     
  FMQ2                        40 (29.9%)   37 (27.6%)     43 (32.6%)          -2.2 (-13.1 - 8.6)     
    dcd B.2.1.2.1             20 (14.9%)   15 (11.2%)     24 (18.2%)          -3.7 (-11.8 - 4.3)     
    dcd B.2.2.3.1             22 (16.4%)   25 (18.7%)     21 (15.9%)          2.2 (-6.9 - 11.3)      
  FMQ3                        31 (23.1%)   36 (26.9%)     40 (30.3%)          3.7 (-6.6 - 14.1)      
    dcd B.2.1.2.1             16 (11.9%)   17 (12.7%)     20 (15.2%)           0.7 (-7.1 - 8.6)      
    dcd B.2.2.3.1             18 (13.4%)   24 (17.9%)     23 (17.4%)          4.5 (-4.2 - 13.2)      
cl C.1                                                                                               
  FMQ1                        14 (10.4%)   19 (14.2%)     21 (15.9%)          3.7 (-4.1 - 11.6)      
    dcd C.1.1.1.3             14 (10.4%)   19 (14.2%)     21 (15.9%)          3.7 (-4.1 - 11.6)      
  FMQ2                        17 (12.7%)   22 (16.4%)     19 (14.4%)          3.7 (-4.7 - 12.2)      
    dcd C.1.1.1.3             17 (12.7%)   22 (16.4%)     19 (14.4%)          3.7 (-4.7 - 12.2)      
  FMQ3                        20 (14.9%)   16 (11.9%)     19 (14.4%)          -3.0 (-11.1 - 5.2)     
    dcd C.1.1.1.3             20 (14.9%)   16 (11.9%)     19 (14.4%)          -3.0 (-11.1 - 5.2)     
cl C.2                                                                                               
  FMQ1                        17 (12.7%)   15 (11.2%)     23 (17.4%)          -1.5 (-9.3 - 6.3)      
    dcd C.2.1.2.1             17 (12.7%)   15 (11.2%)     23 (17.4%)          -1.5 (-9.3 - 6.3)      
  FMQ2                        12 (9.0%)    19 (14.2%)     19 (14.4%)          5.2 (-2.4 - 12.9)      
    dcd C.2.1.2.1             12 (9.0%)    19 (14.2%)     19 (14.4%)          5.2 (-2.4 - 12.9)      
  FMQ3                        12 (9.0%)    16 (11.9%)     19 (14.4%)          3.0 (-4.3 - 10.3)      
    dcd C.2.1.2.1             12 (9.0%)    16 (11.9%)     19 (14.4%)          3.0 (-4.3 - 10.3)      
cl D.1                                                                                               
  FMQ1                        37 (27.6%)   30 (22.4%)     44 (33.3%)          -5.2 (-15.6 - 5.1)     
    dcd D.1.1.1.1             18 (13.4%)   17 (12.7%)     21 (15.9%)          -0.7 (-8.8 - 7.3)      
    dcd D.1.1.4.2             23 (17.2%)   15 (11.2%)     25 (18.9%)          -6.0 (-14.3 - 2.4)     
  FMQ2                        35 (26.1%)   33 (24.6%)     40 (30.3%)          -1.5 (-11.9 - 8.9)     
    dcd D.1.1.1.1             22 (16.4%)   18 (13.4%)     26 (19.7%)          -3.0 (-11.5 - 5.5)     
    dcd D.1.1.4.2             18 (13.4%)   16 (11.9%)     18 (13.6%)          -1.5 (-9.5 - 6.5)      
  FMQ3                        30 (22.4%)   28 (20.9%)     37 (28.0%)          -1.5 (-11.4 - 8.4)     
    dcd D.1.1.1.1             15 (11.2%)   13 (9.7%)      19 (14.4%)          -1.5 (-8.8 - 5.8)      
    dcd D.1.1.4.2             16 (11.9%)   18 (13.4%)     18 (13.6%)           1.5 (-6.5 - 9.5)      
cl D.2                                                                                               
  FMQ1                        17 (12.7%)   27 (20.1%)     22 (16.7%)          7.5 (-1.4 - 16.3)      
    dcd D.2.1.5.3             17 (12.7%)   27 (20.1%)     22 (16.7%)          7.5 (-1.4 - 16.3)      
  FMQ2                        25 (18.7%)   21 (15.7%)     24 (18.2%)          -3.0 (-12.0 - 6.0)     
    dcd D.2.1.5.3             25 (18.7%)   21 (15.7%)     24 (18.2%)          -3.0 (-12.0 - 6.0)     
  FMQ3                        13 (9.7%)    20 (14.9%)     19 (14.4%)          5.2 (-2.6 - 13.1)      
    dcd D.2.1.5.3             13 (9.7%)    20 (14.9%)     19 (14.4%)          5.2 (-2.6 - 13.1)      
# Load Libraries & Data
library(dplyr)
library(cardinal)

adsl <- random.cdisc.data::cadsl
adae <- random.cdisc.data::cadae

# Pre-Processing - Ensure required variables fmqsc_var and fmqnam_var exist in adae
set.seed(1)
adae <- adae %>%
  rename(FMQ01SC = SMQ01SC) %>%
  mutate(
    AESER = sample(c("Y", "N"), size = nrow(adae), replace = TRUE),
    FMQ01NAM = sample(c("FMQ1", "FMQ2", "FMQ3"), size = nrow(adae), replace = TRUE)
  )
adae$FMQ01SC[is.na(adae$FMQ01SC)] <- "BROAD"

# Select Preferred Term Variable
pref_var <- "AEDECOD"

# Output Table
risk_diff <- list(arm_x = "B: Placebo", arm_y = "A: Drug X") # optional
make_table_38(adae = adae, alt_counts_df = adsl, pref_var = pref_var, risk_diff = risk_diff)

make_table_38()


Required variables:

  • adae: USUBJID, AEBODSYS, AESER, and the variables specified by arm_var, saffl_var, trtemfl_var, fmqsc_var, fmqnam_var, and pref_var.
  • alt_counts_df (if specified): USUBJID and the variables specified by arm_var and saffl_var.
Argument Description Default
adae (data.frame) Dataset (typically ADAE) required to build table. No default
alt_counts_df (character) Alternative dataset used only to calculate column counts. NULL
show_colcounts (flag) Whether column counts should be printed. TRUE
id_var (character) variable used as unique subject identifier. USUBJID
arm_var (character) Arm variable used to split table into columns. "ARM"
saffl_var (character) Flag variable used to indicate inclusion in safety population. "SAFFL"
trtemfl_var (character) Flag variable used to identify Treatment-emergent AE. "TRTEMFL"
fmqsc_var (character) FMQ scope variable to use in table. "FMQ01SC"
fmqnam_var (character) FMQ reference name variable to use in table. "FMQ01NAM"
fmq_scope (character) FMQ scope, can be ‘“NARROW”’ or ‘“BROAD”’. "NARROW"
pref_var (character) Preferred term variable from adae to include in the table. "AEDECOD"
lbl_overall (character) If specified, an overall column will be added to the table with the given value as the column label. NULL
lbl_pref_var (character) Label corresponding to preferred term variable pref_var to print in the table. formatters::var_labels(adae, fill = TRUE)[pref_var]
risk_diff

(named list) List of settings to apply to add a risk difference column to the table. See tern::add_riskdiff() for more details. List should contain the following elements:

  • arm_x: (required) the name of reference arm.

  • arm_y: (required) the name of the arm to compare to the reference arm.

  • col_label: (optional) label to use for the risk difference column. Defaults to "Risk Difference (%) (95% CI)".

  • pct: (optional) whether the output should be returned as percentages. Defaults to TRUE.

NULL
prune_0 (flag) Whether all-zero rows should be removed from the table. TRUE
na_level (character) String to represent missing values. "<Missing>"
annotations (named list of character) List of annotations to add to the table. Valid annotation types are title, subtitles, main_footer, and prov_footer. Each name-value pair should use the annotation type as name and the desired string as value. NULL

Source code for this function is available here.

Source Code
---
title: FDA Table 38
subtitle: Patients With Adverse Events by System Organ Class, FDA Medical Query (Broad) and Preferred Term, Safety Population, Pooled Analysis (or Trial X)
format: html
---

::: panel-tabset
## Spec. Screenshot

![](../assets/images/screenshots/table_38.png){fig-align="center"}

## rtables Table

```{r tbl, message=FALSE, warning=FALSE}
# Load Libraries & Data
library(dplyr)
library(cardinal)

adsl <- random.cdisc.data::cadsl
adae <- random.cdisc.data::cadae

# Pre-Processing - Ensure required variables fmqsc_var and fmqnam_var exist in adae
set.seed(1)
adae <- adae %>%
  rename(FMQ01SC = SMQ01SC) %>%
  mutate(
    AESER = sample(c("Y", "N"), size = nrow(adae), replace = TRUE),
    FMQ01NAM = sample(c("FMQ1", "FMQ2", "FMQ3"), size = nrow(adae), replace = TRUE)
  )
adae$FMQ01SC[is.na(adae$FMQ01SC)] <- "BROAD"

# Select Preferred Term Variable
pref_var <- "AEDECOD"

# Output Table
risk_diff <- list(arm_x = "B: Placebo", arm_y = "A: Drug X") # optional
make_table_38(adae = adae, alt_counts_df = adsl, pref_var = pref_var, risk_diff = risk_diff)
```

## rtables Table Setup

```{r tbl, eval=FALSE, echo=TRUE}
```

## Function Details

### `make_table_38()`

------------------------------------------------------------------------

Required variables:

-   **`adae`**: `USUBJID`, `AEBODSYS`, `AESER`, and the variables specified by `arm_var`, `saffl_var`, `trtemfl_var`, `fmqsc_var`, `fmqnam_var`, and `pref_var`.
-   **`alt_counts_df`** (if specified): `USUBJID` and the variables specified by `arm_var` and `saffl_var`.

+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------+
| **Argument**     | **Description**                                                                                                                                                                                                                                                | **Default**                                           |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------+
| `adae`           | (`data.frame`) Dataset (typically ADAE) required to build table.                                                                                                                                                                                               | *No default*                                          |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------+
| `alt_counts_df`  | (`character`) Alternative dataset used only to calculate column counts.                                                                                                                                                                                        | `NULL`                                                |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------+
| `show_colcounts` | (`flag`) Whether column counts should be printed.                                                                                                                                                                                                              | `TRUE`                                                |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------+
| `id_var`         | (`character`) variable used as unique subject identifier.                                                                                                                                                                                                      | `USUBJID`                                             |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------+
| `arm_var`        | (`character`) Arm variable used to split table into columns.                                                                                                                                                                                                   | `"ARM"`                                               |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------+
| `saffl_var`      | (`character`) Flag variable used to indicate inclusion in safety population.                                                                                                                                                                                   | `"SAFFL"`                                             |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------+
| `trtemfl_var`    | (`character`) Flag variable used to identify Treatment-emergent AE.                                                                                                                                                                                            | `"TRTEMFL"`                                           |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------+
| `fmqsc_var`      | (`character`) FMQ scope variable to use in table.                                                                                                                                                                                                              | `"FMQ01SC"`                                           |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------+
| `fmqnam_var`     | (`character`) FMQ reference name variable to use in table.                                                                                                                                                                                                     | `"FMQ01NAM"`                                          |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------+
| `fmq_scope`      | (`character`) FMQ scope, can be '"NARROW"' or '"BROAD"'.                                                                                                                                                                                                       | `"NARROW"`                                            |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------+
| `pref_var`       | (`character`) Preferred term variable from `adae` to include in the table.                                                                                                                                                                                     | `"AEDECOD"`                                           |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------+
| `lbl_overall`    | (`character`) If specified, an overall column will be added to the table with the given value as the column label.                                                                                                                                             | `NULL`                                                |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------+
| `lbl_pref_var`   | (`character`) Label corresponding to preferred term variable `pref_var` to print in the table.                                                                                                                                                                 | `formatters::var_labels(adae, fill = TRUE)[pref_var]` |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------+
| `risk_diff`      | (named `list`) List of settings to apply to add a risk difference column to the table. See [`tern::add_riskdiff()`](https://insightsengineering.github.io/tern/main/reference/add_riskdiff.html) for more details. List should contain the following elements: | `NULL`                                                |
|                  |                                                                                                                                                                                                                                                                |                                                       |
|                  | -   `arm_x`: (required) the name of reference arm.                                                                                                                                                                                                             |                                                       |
|                  |                                                                                                                                                                                                                                                                |                                                       |
|                  | -   `arm_y`: (required) the name of the arm to compare to the reference arm.                                                                                                                                                                                   |                                                       |
|                  |                                                                                                                                                                                                                                                                |                                                       |
|                  | -   `col_label`: (optional) label to use for the risk difference column. Defaults to `"Risk Difference (%) (95% CI)"`.                                                                                                                                         |                                                       |
|                  |                                                                                                                                                                                                                                                                |                                                       |
|                  | -   `pct`: (optional) whether the output should be returned as percentages. Defaults to `TRUE`.                                                                                                                                                                |                                                       |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------+
| `prune_0`        | (`flag`) Whether all-zero rows should be removed from the table.                                                                                                                                                                                               | `TRUE`                                                |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------+
| `na_level`       | (`character`) String to represent missing values.                                                                                                                                                                                                              | `"<Missing>"`                                         |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------+
| `annotations`    | (named `list` of `character`) List of annotations to add to the table. Valid annotation types are `title`, `subtitles`, `main_footer`, and `prov_footer.` Each name-value pair should use the annotation type as name and the desired string as value.         | `NULL`                                                |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------+

Source code for this function is available [here](https://github.com/pharmaverse/cardinal/blob/main/R/fda-table_38.R).
:::
 
  • This website as well as code examples are licensed under the Apache License, Version 2.0.
Cookie Preferences