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 36

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

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

                             A: Drug X    B: Placebo   C: Combination   Risk Difference (%) (95% CI)
Primary System Organ Class    (N=134)      (N=134)        (N=132)                 (N=268)           
————————————————————————————————————————————————————————————————————————————————————————————————————
cl A                         78 (58.2%)   75 (56.0%)     89 (67.4%)          -2.2 (-14.1 - 9.6)     
  dcd A.1.1.1.1              50 (37.3%)   45 (33.6%)     63 (47.7%)          -3.7 (-15.2 - 7.7)     
  dcd A.1.1.1.2              48 (35.8%)   48 (35.8%)     50 (37.9%)          0.0 (-11.5 - 11.5)     
cl B                         96 (71.6%)   89 (66.4%)     97 (73.5%)          -5.2 (-16.3 - 5.8)     
  dcd B.1.1.1.1              47 (35.1%)   49 (36.6%)     43 (32.6%)          1.5 (-10.0 - 13.0)     
  dcd B.2.1.2.1              49 (36.6%)   44 (32.8%)     52 (39.4%)          -3.7 (-15.1 - 7.7)     
  dcd B.2.2.3.1              48 (35.8%)   54 (40.3%)     51 (38.6%)          4.5 (-7.1 - 16.1)      
cl C                         67 (50.0%)   75 (56.0%)     79 (59.8%)          6.0 (-6.0 - 17.9)      
  dcd C.1.1.1.3              43 (32.1%)   46 (34.3%)     43 (32.6%)          2.2 (-9.0 - 13.5)      
  dcd C.2.1.2.1              35 (26.1%)   48 (35.8%)     55 (41.7%)          9.7 (-1.3 - 20.7)      
cl D                         96 (71.6%)   90 (67.2%)     98 (74.2%)          -4.5 (-15.5 - 6.5)     
  dcd D.1.1.1.1              50 (37.3%)   42 (31.3%)     51 (38.6%)          -6.0 (-17.3 - 5.4)     
  dcd D.1.1.4.2              48 (35.8%)   42 (31.3%)     50 (37.9%)          -4.5 (-15.8 - 6.8)     
  dcd D.2.1.5.3              47 (35.1%)   58 (43.3%)     57 (43.2%)          8.2 (-3.4 - 19.9)      
# Load Libraries & Data
library(random.cdisc.data)
library(cardinal)

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

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

make_table_36()


Required variables:

  • adae: The variables specified by id_var, arm_var, saffl_var, soc_var, and pref_var.
  • alt_counts_df (if specified): The variables specified by id_var, 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 (typically ADSL) used only to calculate column counts. NULL
show_colcounts (flag) Whether column counts should be printed. TRUE
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"
soc_var (character) SOC variable from adae to include in the table. "AESOC"
pref_var (character) Preferred term variable from adae to include in the table. "AEDECOD"
lbl_soc_var (character) Label corresponding to SOC variable soc_var to print in the table. formatters::var_labels(adae, fill = TRUE)[soc_var]
lbl_overall (character) If specified, an overall column will be added to the table with the given value as the column label. NULL
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. FALSE
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 36
subtitle:  Patients With Adverse Events by System Organ Class and Preferred Term, Safety Population, Pooled Analysis (or Trial X)
format: html
---

::: panel-tabset
## Spec. Screenshot

![](../assets/images/screenshots/table_36.png){fig-align="center" width="70%"}

## Table

```{r tbl, message=FALSE, warning=FALSE}
# Load Libraries & Data
library(random.cdisc.data)
library(cardinal)

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

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

## Table Setup

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

## Function Details

### `make_table_36()`

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

Required variables:

-   **`adae`**: The variables specified by `id_var`, `arm_var`, `saffl_var`, `soc_var`, and `pref_var`.
-   **`alt_counts_df`** (if specified): The variables specified by `id_var`, `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 (typically ADSL) used only to calculate column counts.                                                                                                                                                                       | `NULL`                                               |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------+
| `show_colcounts` | (`flag`) Whether column counts should be printed.                                                                                                                                                                                                              | `TRUE`                                               |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------+
| `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"`                                            |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------+
| `soc_var`        | (`character`) SOC variable from `adae` to include in the table.                                                                                                                                                                                                | `"AESOC"`                                            |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------+
| `pref_var`       | (`character`) Preferred term variable from `adae` to include in the table.                                                                                                                                                                                     | `"AEDECOD"`                                          |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------+
| `lbl_soc_var`    | (`character`) Label corresponding to SOC variable `soc_var` to print in the table.                                                                                                                                                                             | `formatters::var_labels(adae, fill = TRUE)[soc_var]` |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------+
| `lbl_overall`    | (`character`) If specified, an overall column will be added to the table with the given value as the column label.                                                                                                                                             | `NULL`                                               |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------+
| `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.                                                                                                                                                                                               | `FALSE`                                              |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------+
| `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_36.R).
:::
 
  • This website as well as code examples are licensed under the Apache License, Version 2.0.
Cookie Preferences