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 3

Patient Screening and Enrollment, Trials A and B

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

Disposition                              A: Drug X    B: Placebo    C: Combination
——————————————————————————————————————————————————————————————————————————————————
Patients screened                           134           134            132      
Screening failures                       42 (31.3%)   32 (23.9%)      26 (19.7%)  
  Inclusion/exclusion criteria not met    6 (4.5%)     10 (7.5%)      10 (7.6%)   
  Patient noncompliance                  12 (9.0%)     2 (1.5%)        6 (4.5%)   
  Consent withdrawn                      13 (9.7%)     12 (9.0%)       5 (3.8%)   
  Other                                  11 (8.2%)     8 (6.0%)        5 (3.8%)   
Patients enrolled                        92 (68.7%)   102 (76.1%)    106 (80.3%)  
Patients randomized                      92 (68.7%)   102 (76.1%)    106 (80.3%)  
# Load Libraries & Data
library(dplyr)
library(cardinal)

adsl <- random.cdisc.data::cadsl

# Pre-Processing - Add all required screening variables are in df
set.seed(1)
adsl <- random.cdisc.data::cadsl
adsl$RANDDT[sample(seq_len(nrow(adsl)), 100)] <- NA
adsl <- adsl %>%
  mutate(
    ENRLDT = RANDDT,
    SCRNFL = "Y",
    SCRNFRS = factor(sample(
      c("Inclusion/exclusion criteria not met", "Patient noncompliance", "Consent withdrawn", "Other"),
      size = nrow(adsl), replace = TRUE
    ), levels = c("Inclusion/exclusion criteria not met", "Patient noncompliance", "Consent withdrawn", "Other")),
    SCRNFAILFL = ifelse(is.na(ENRLDT), "Y", "N")
  )
adsl$SCRNFRS[adsl$SCRNFL == "N" | !is.na(adsl$ENRLDT)] <- NA

# Output Table
make_table_03(df = adsl, scrnfl_var = "SCRNFL", scrnfailfl_var = "SCRNFAILFL", scrnfail_var = "SCRNFRS")

make_table_3()


Required variables:

  • adsl: USUBJID, ENRLDT, RANDDT, and the variables specified by arm_var, scrnfl_var, scrnfailfl_var, and scrnfail_var.
  • alt_counts_df (if specified): USUBJID, and the variable specified by arm_var.
Argument Description Default
adsl (data.frame) Dataset (typically ADSL) 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. FALSE
arm_var (character) Arm variable used to split table into columns. "ARM"
scrnfl_var (character) Variable from df that indicates whether patients were screened. No default
scrnfailfl_var (character) Variable from df that indicates screening failure. No default
scrnfail_var (character) Variable from df that contains reasons for screening failure. No default
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. TRUE
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 3
subtitle: Patient Screening and Enrollment, Trials A and B
format: html
---

::: panel-tabset
## Spec. Screenshot

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

## rtables Table

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

adsl <- random.cdisc.data::cadsl

# Pre-Processing - Add all required screening variables are in df
set.seed(1)
adsl <- random.cdisc.data::cadsl
adsl$RANDDT[sample(seq_len(nrow(adsl)), 100)] <- NA
adsl <- adsl %>%
  mutate(
    ENRLDT = RANDDT,
    SCRNFL = "Y",
    SCRNFRS = factor(sample(
      c("Inclusion/exclusion criteria not met", "Patient noncompliance", "Consent withdrawn", "Other"),
      size = nrow(adsl), replace = TRUE
    ), levels = c("Inclusion/exclusion criteria not met", "Patient noncompliance", "Consent withdrawn", "Other")),
    SCRNFAILFL = ifelse(is.na(ENRLDT), "Y", "N")
  )
adsl$SCRNFRS[adsl$SCRNFL == "N" | !is.na(adsl$ENRLDT)] <- NA

# Output Table
make_table_03(df = adsl, scrnfl_var = "SCRNFL", scrnfailfl_var = "SCRNFAILFL", scrnfail_var = "SCRNFRS")
```

## rtables Table Setup

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

## Function Details

### `make_table_3()`

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

Required variables:

-   **`adsl`**: `USUBJID`, `ENRLDT`, `RANDDT`, and the variables specified by `arm_var`, `scrnfl_var`, `scrnfailfl_var`, and `scrnfail_var`.
-   **`alt_counts_df`** (if specified): `USUBJID`, and the variable specified by `arm_var`.

| **Argument**     | **Description**                                                                                                                                                                                                                                        | **Default**  |
|:-----------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-------------|
| `adsl`           | (`data.frame`) Dataset (typically ADSL) 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.                                                                                                                                                                                                      | `FALSE`      |
| `arm_var`        | (`character`) Arm variable used to split table into columns.                                                                                                                                                                                           | `"ARM"`      |
| `scrnfl_var`     | (`character`) Variable from `df` that indicates whether patients were screened.                                                                                                                                                                        | *No default* |
| `scrnfailfl_var` | (`character`) Variable from `df` that indicates screening failure.                                                                                                                                                                                     | *No default* |
| `scrnfail_var`   | (`character`) Variable from `df` that contains reasons for screening failure.                                                                                                                                                                          | *No default* |
| `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.                                                                                                                                                                                       | `TRUE`       |
| `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_03.R).
:::
 
  • This website as well as code examples are licensed under the Apache License, Version 2.0.
Cookie Preferences