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 4

Patient Disposition, Pooled Analyses

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

                          A: Drug X    B: Placebo   C: Combination   Risk Difference (%) (95% CI)
                           (N=134)      (N=134)        (N=132)                 (N=268)           
—————————————————————————————————————————————————————————————————————————————————————————————————
Patients randomized       67 (50.0%)   61 (45.5%)     68 (51.5%)          -4.5 (-16.4 - 7.5)     
ITT/mITT population       134 (100%)   134 (100%)     132 (100%)           0.0 (0.0 - 0.0)       
Safety population         134 (100%)   134 (100%)     132 (100%)           0.0 (0.0 - 0.0)       
Per-protocol population   67 (50.0%)   61 (45.5%)     68 (51.5%)          -4.5 (-16.4 - 7.5)     
Discontinued study drug   42 (31.3%)   40 (29.9%)     38 (28.8%)          -1.5 (-12.5 - 9.5)     
  Adverse event            3 (2.2%)     6 (4.5%)       5 (3.8%)            2.2 (-2.1 - 6.5)      
  Lack of efficacy         2 (1.5%)     2 (1.5%)       3 (2.3%)            0.0 (-2.9 - 2.9)      
  Protocol deviation          0            0              0                0.0 (0.0 - 0.0)       
  Death                   25 (18.7%)   23 (17.2%)     22 (16.7%)          -1.5 (-10.7 - 7.7)     
  Withdrawal by subject       0            0              0                0.0 (0.0 - 0.0)       
  Other                    3 (2.2%)     4 (3.0%)       3 (2.3%)            0.7 (-3.1 - 4.6)      
Discontinued study        42 (31.3%)   40 (29.9%)     38 (28.8%)          -1.5 (-12.5 - 9.5)     
  Death                   25 (18.7%)   23 (17.2%)     22 (16.7%)          -1.5 (-10.7 - 7.7)     
  Lost to follow-up           0            0              0                0.0 (0.0 - 0.0)       
  Withdrawal by subject       0            0              0                0.0 (0.0 - 0.0)       
  Physician decision          0            0              0                0.0 (0.0 - 0.0)       
  Protocol deviation       5 (3.7%)     3 (2.2%)       4 (3.0%)           -1.5 (-5.6 - 2.6)      
  Other                    3 (2.2%)     4 (3.0%)       3 (2.3%)            0.7 (-3.1 - 4.6)      
# Load Libraries & Data
library(cardinal)
library(dplyr)

adsl <- random.cdisc.data::cadsl %>%
  mutate(test = rbinom(400, 1, 0.5)) %>%
  mutate(
    RANDFL = ifelse(test == 0, "N", "Y"),
    PPROTFL = ifelse(test == 0, "N", "Y"),
    DCSREAS = if_else(DCSREAS %in% c(
      "ADVERSE EVENT", "LACK OF EFFICACY", "PROTOCOL VIOLATION",
      "DEATH", "WITHDRAWAL BY PARENT/GUARDIAN"
    ), DCSREAS, "OTHER")
  )

# Output Table
risk_diff <- list(arm_x = "B: Placebo", arm_y = "A: Drug X") # optional
tbl <- make_table_04(
  df = adsl, pop_vars = c("RANDFL", "ITTFL", "SAFFL", "PPROTFL"),
  lbl_pop_vars = c("Patients randomized", "ITT/mITT population", "Safety population", "Per-protocol population"),
  risk_diff = risk_diff
)
tbl

make_table_04()


Required variables:

  • df: USUBJID, EOTSTT, DCSREAS, EOSSTT, DCSREAS and the variables specified by arm_var and pop_var.

  • alt_counts_df (if specified): USUBJID, and the variable specified by arm_var and pop_var.

Argument Description Default
df (data.frame) Dataset (typically ADSL) required to build table. No default
alt_counts_df (character) Alternative dataset used only to calculate column counts. NULL
arm_var (character) Arm variable used to split table into columns. "ARM"
pop_vars (named list of character) List of Population variables to use in Table c("SAFFL")
lbl_pop_vars (named list of character) List of row labels for populations defined by pop_vars c("Safety population")
lbl_overall (character) If specified, an overall column will be added to the table with the given value as the column label. 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 4
subtitle: Patient Disposition, Pooled Analyses
format: html
---

::: panel-tabset
## Spec. Screenshot

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

## rtables Table

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

adsl <- random.cdisc.data::cadsl %>%
  mutate(test = rbinom(400, 1, 0.5)) %>%
  mutate(
    RANDFL = ifelse(test == 0, "N", "Y"),
    PPROTFL = ifelse(test == 0, "N", "Y"),
    DCSREAS = if_else(DCSREAS %in% c(
      "ADVERSE EVENT", "LACK OF EFFICACY", "PROTOCOL VIOLATION",
      "DEATH", "WITHDRAWAL BY PARENT/GUARDIAN"
    ), DCSREAS, "OTHER")
  )

# Output Table
risk_diff <- list(arm_x = "B: Placebo", arm_y = "A: Drug X") # optional
tbl <- make_table_04(
  df = adsl, pop_vars = c("RANDFL", "ITTFL", "SAFFL", "PPROTFL"),
  lbl_pop_vars = c("Patients randomized", "ITT/mITT population", "Safety population", "Per-protocol population"),
  risk_diff = risk_diff
)
tbl
```

## rtables Table Setup

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

## Function Details

### `make_table_04()`

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

Required variables:

-   **`df`**: `USUBJID`, `EOTSTT`, `DCSREAS`, `EOSSTT`, `DCSREAS` and the variables specified by `arm_var` and `pop_var`.

-   **`alt_counts_df`** (if specified): `USUBJID`, and the variable specified by `arm_var` and `pop_var`.

| **Argument**    | **Description**                                                                                                                                                                                                                                        | **Default**              |
|:------------------|:---------------------------------|:------------------|
| `df`            | (`data.frame`) Dataset (typically ADSL) required to build table.                                                                                                                                                                                       | *No default*             |
| `alt_counts_df` | (`character`) Alternative dataset used only to calculate column counts.                                                                                                                                                                                | `NULL`                   |
| `arm_var`       | (`character`) Arm variable used to split table into columns.                                                                                                                                                                                           | `"ARM"`                  |
| `pop_vars`      | (named `list` of `character`) List of Population variables to use in Table                                                                                                                                                                             | `c("SAFFL")`             |
| `lbl_pop_vars`  | (named `list` of `character`) List of row labels for populations defined by `pop_vars`                                                                                                                                                                 | `c("Safety population")` |
| `lbl_overall`   | (`character`) If specified, an overall column will be added to the table with the given value as the column label.                                                                                                                                     | `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](https://github.com/pharmaverse/cardinal/blob/main/R/fda-table_04.R).
:::
 
  • This website as well as code examples are licensed under the Apache License, Version 2.0.
Cookie Preferences