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 7

Deaths, Safety Population, Pooled Analyses

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

                                  A: Drug X    B: Placebo   C: Combination   Risk Difference (%) (95% CI)
Deaths                             (N=134)      (N=134)        (N=132)                 (N=268)           
—————————————————————————————————————————————————————————————————————————————————————————————————————————
Total deaths                      24 (17.9%)   19 (14.2%)     20 (15.2%)          -3.7 (-12.5 - 5.0)     
  ADVERSE EVENT                   8 (33.3%)    6 (31.6%)      10 (50.0%)          -1.5 (-6.8 - 3.8)      
  DISEASE PROGRESSION             8 (33.3%)    5 (26.3%)      6 (30.0%)           -2.2 (-7.4 - 2.9)      
  LOST TO FOLLOW UP                2 (8.3%)     1 (5.3%)       1 (5.0%)           -0.7 (-3.3 - 1.8)      
  MISSING                          2 (8.3%)    3 (15.8%)       1 (5.0%)            0.7 (-2.5 - 4.0)      
  Post-study reporting of death    1 (4.2%)     1 (5.3%)       1 (5.0%)            0.0 (-2.1 - 2.1)      
  SUICIDE                          2 (8.3%)    2 (10.5%)       1 (5.0%)            0.0 (-2.9 - 2.9)      
  UNKNOWN                          1 (4.2%)     1 (5.3%)          0                0.0 (-2.1 - 2.1)      
Treatment-emergent deaths         12 (9.0%)    15 (11.2%)     16 (12.1%)           2.2 (-5.0 - 9.4)      
  ADVERSE EVENT                   3 (25.0%)    5 (33.3%)      9 (56.2%)            1.5 (-2.6 - 5.6)      
  DISEASE PROGRESSION             3 (25.0%)    5 (33.3%)      4 (25.0%)            1.5 (-2.6 - 5.6)      
  LOST TO FOLLOW UP                1 (8.3%)        0              0               -0.7 (-2.2 - 0.7)      
  MISSING                         2 (16.7%)     1 (6.7%)       1 (6.2%)           -0.7 (-3.3 - 1.8)      
  Post-study reporting of death       0         1 (6.7%)       1 (6.2%)            0.7 (-0.7 - 2.2)      
  SUICIDE                         2 (16.7%)    2 (13.3%)       1 (6.2%)            0.0 (-2.9 - 2.9)      
  UNKNOWN                          1 (8.3%)     1 (6.7%)          0                0.0 (-2.1 - 2.1)      
Nontreatment-emergent deaths      12 (9.0%)     4 (3.0%)       4 (3.0%)          -6.0 (-11.6 - -0.3)     
  ADVERSE EVENT                   5 (41.7%)    1 (25.0%)      1 (25.0%)           -3.0 (-6.5 - 0.5)      
  DISEASE PROGRESSION             5 (41.7%)        0          2 (50.0%)           -3.7 (-6.9 - -0.5)     
  LOST TO FOLLOW UP                1 (8.3%)    1 (25.0%)      1 (25.0%)            0.0 (-2.1 - 2.1)      
  MISSING                             0        2 (50.0%)          0                1.5 (-0.6 - 3.5)      
  Post-study reporting of death    1 (8.3%)        0              0               -0.7 (-2.2 - 0.7)      
# Load Libraries & Data
library(cardinal)

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

# Pre-Processing - Ensure all required variables are present in adae
set.seed(1)
adae$TRTEMFL <- ifelse(adae$USUBJID %in% sample(adsl$USUBJID, size = as.integer(nrow(adsl) / 3)), "N", "Y")

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

make_table_07()


Required variables:

  • adae: USUBJID, TRTEMFL, DTHFL, DTHCAUS, and the variables specified by arm_var and saffl_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 (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"
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. 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 7
subtitle: Deaths, Safety Population, Pooled Analyses
format: html
---

::: panel-tabset
## Spec. Screenshot

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

## rtables Table

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

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

# Pre-Processing - Ensure all required variables are present in adae
set.seed(1)
adae$TRTEMFL <- ifelse(adae$USUBJID %in% sample(adsl$USUBJID, size = as.integer(nrow(adsl) / 3)), "N", "Y")

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

## rtables Table Setup

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

## Function Details

### `make_table_07()`

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

Required variables:

-   **`adae`**: `USUBJID`, `TRTEMFL`, `DTHFL`, `DTHCAUS`, and the variables specified by `arm_var` and `saffl_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 (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"`    |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+
| `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.                                                                                                                                                                                               | `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_07.R).
:::
 
  • This website as well as code examples are licensed under the Apache License, Version 2.0.
Cookie Preferences