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 17

Patients With Adverse Events by Female-Specific FDA Medical Query (Narrow) and Preferred Term, Female Safety Population, Pooled Analyses

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

FMQ (Narrow)                   A: Drug X   B: Placebo   C: Combination   Risk Difference (%) (95% CI)
  Preferred Term                (N=134)     (N=134)        (N=132)                 (N=268)           
—————————————————————————————————————————————————————————————————————————————————————————————————————
Abnormal Uterine Bleeding                                                                            
  dcd A.1.1.1.1                13 (9.7%)   10 (7.5%)      10 (7.6%)           -2.2 (-8.9 - 4.5)      
  dcd A.1.1.1.2                10 (7.5%)    9 (6.7%)      14 (10.6%)          -0.7 (-6.9 - 5.4)      
  dcd B.1.1.1.1                6 (4.5%)     7 (5.2%)       7 (5.3%)            0.7 (-4.4 - 5.9)      
  dcd B.2.1.2.1                9 (6.7%)     8 (6.0%)       6 (4.5%)           -0.7 (-6.6 - 5.1)      
  dcd C.2.1.2.1                7 (5.2%)     8 (6.0%)      11 (8.3%)            0.7 (-4.8 - 6.2)      
  dcd D.1.1.1.1                3 (2.2%)    13 (9.7%)       9 (6.8%)            7.5 (1.9 - 13.1)      
  dcd D.1.1.4.2                13 (9.7%)    8 (6.0%)       9 (6.8%)           -3.7 (-10.2 - 2.7)     
  dcd D.2.1.5.3                9 (6.7%)    11 (8.2%)      11 (8.3%)            1.5 (-4.8 - 7.8)      
Amenorrhea                                                                                           
  dcd A.1.1.1.1                7 (5.2%)     8 (6.0%)      16 (12.1%)           0.7 (-4.8 - 6.2)      
  dcd A.1.1.1.2                12 (9.0%)   14 (10.4%)      5 (3.8%)            1.5 (-5.6 - 8.6)      
  dcd B.1.1.1.1                9 (6.7%)    14 (10.4%)      9 (6.8%)           3.7 (-3.0 - 10.4)      
  dcd B.2.1.2.1                13 (9.7%)   10 (7.5%)       8 (6.1%)           -2.2 (-8.9 - 4.5)      
  dcd C.2.1.2.1                6 (4.5%)     6 (4.5%)       9 (6.8%)            0.0 (-5.0 - 5.0)      
  dcd D.1.1.1.1                11 (8.2%)    6 (4.5%)       8 (6.1%)           -3.7 (-9.6 - 2.1)      
  dcd D.1.1.4.2                8 (6.0%)     3 (2.2%)       4 (3.0%)           -3.7 (-8.5 - 1.0)      
  dcd D.2.1.5.3                7 (5.2%)    13 (9.7%)       9 (6.8%)           4.5 (-1.8 - 10.7)      
Bacterial Vaginosis                                                                                  
  dcd A.1.1.1.1                8 (6.0%)     9 (6.7%)       5 (3.8%)            0.7 (-5.1 - 6.6)      
  dcd A.1.1.1.2                6 (4.5%)     9 (6.7%)       8 (6.1%)            2.2 (-3.3 - 7.7)      
  dcd B.1.1.1.1                10 (7.5%)    9 (6.7%)       6 (4.5%)           -0.7 (-6.9 - 5.4)      
  dcd B.2.1.2.1                9 (6.7%)    10 (7.5%)       5 (3.8%)            0.7 (-5.4 - 6.9)      
  dcd C.2.1.2.1                7 (5.2%)    12 (9.0%)       5 (3.8%)            3.7 (-2.4 - 9.9)      
  dcd D.1.1.1.1                8 (6.0%)    11 (8.2%)       7 (5.3%)            2.2 (-3.9 - 8.4)      
  dcd D.1.1.4.2                8 (6.0%)     7 (5.2%)      12 (9.1%)           -0.7 (-6.2 - 4.8)      
  dcd D.2.1.5.3                7 (5.2%)    11 (8.2%)       9 (6.8%)            3.0 (-3.0 - 9.0)      
Decreased Menstrual Bleeding                                                                         
  dcd A.1.1.1.1                12 (9.0%)   13 (9.7%)       9 (6.8%)            0.7 (-6.2 - 7.7)      
  dcd A.1.1.1.2                10 (7.5%)   11 (8.2%)       7 (5.3%)            0.7 (-5.7 - 7.2)      
  dcd B.1.1.1.1                6 (4.5%)     6 (4.5%)       8 (6.1%)            0.0 (-5.0 - 5.0)      
  dcd B.2.1.2.1                5 (3.7%)    12 (9.0%)       6 (4.5%)           5.2 (-0.6 - 11.0)      
  dcd C.2.1.2.1                8 (6.0%)    13 (9.7%)       8 (6.1%)           3.7 (-2.7 - 10.2)      
  dcd D.1.1.1.1                8 (6.0%)     6 (4.5%)      11 (8.3%)           -1.5 (-6.8 - 3.8)      
  dcd D.1.1.4.2                9 (6.7%)     8 (6.0%)       8 (6.1%)           -0.7 (-6.6 - 5.1)      
  dcd D.2.1.5.3                11 (8.2%)   12 (9.0%)      12 (9.1%)            0.7 (-6.0 - 7.5)      
# Load Libraries & Data
library(cardinal)

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

# Pre-Processing - Ensure required variables FMQ01SC and FMQ01NAM exist in adae
set.seed(1)
adae <- dplyr::rename(adae, FMQ01SC = SMQ01SC, FMQ01NAM = SMQ01NAM)
levels(adae$FMQ01SC) <- c("BROAD", "NARROW")
adae$FMQ01SC[is.na(adae$FMQ01SC)] <- "NARROW"
adae$FMQ01NAM <- factor(adae$FMQ01NAM, levels = c(
  unique(adae$FMQ01NAM), "Abnormal Uterine Bleeding", "Amenorrhea",
  "Bacterial Vaginosis", "Decreased Menstrual Bleeding"
))
adae$FMQ01NAM[adae$SEX == "F"] <- as.factor(
  sample(c(
    "Abnormal Uterine Bleeding", "Amenorrhea",
    "Bacterial Vaginosis", "Decreased Menstrual Bleeding"
  ), sum(adae$SEX == "F"), replace = TRUE)
)

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

make_table_17()


Required variables:

  • adae: adae must contain USUBJID, SEX, and the variables specified by arm_var, saffl_var, pref_var, fmqsc_var and fmqnam_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
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"
pref_var (character) Preferred term variable to use in table. "AEDECOD"
sex_scope (character) Level of SEX to output in table. "F"
fmq_scope (character) FMQ scope value to use in table. "NARROW"
fmqsc_var (character) FMQ scope variable to use in table. "FMQ01SC"
fmqnam_var (character) FMQ reference name variable to use in table. "FMQ01NAM"
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
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 17
subtitle: Patients With Adverse Events by Female-Specific FDA Medical Query (Narrow) and Preferred Term, Female Safety Population, Pooled Analyses
format: html
---

::: panel-tabset
## Spec. Screenshot

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

## 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 required variables FMQ01SC and FMQ01NAM exist in adae
set.seed(1)
adae <- dplyr::rename(adae, FMQ01SC = SMQ01SC, FMQ01NAM = SMQ01NAM)
levels(adae$FMQ01SC) <- c("BROAD", "NARROW")
adae$FMQ01SC[is.na(adae$FMQ01SC)] <- "NARROW"
adae$FMQ01NAM <- factor(adae$FMQ01NAM, levels = c(
  unique(adae$FMQ01NAM), "Abnormal Uterine Bleeding", "Amenorrhea",
  "Bacterial Vaginosis", "Decreased Menstrual Bleeding"
))
adae$FMQ01NAM[adae$SEX == "F"] <- as.factor(
  sample(c(
    "Abnormal Uterine Bleeding", "Amenorrhea",
    "Bacterial Vaginosis", "Decreased Menstrual Bleeding"
  ), sum(adae$SEX == "F"), replace = TRUE)
)

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

## rtables Table Setup

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

## Function Details

### `make_table_17()`

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

Required variables:

-   **`adae`**: `adae` must contain `USUBJID`, `SEX`, and the variables specified by `arm_var`, `saffl_var`, `pref_var`, `fmqsc_var` and `fmqnam_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`        |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+
| `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"`     |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+
| `pref_var`       | (`character`) Preferred term variable to use in table.                                                                                                                                                                                                         | `"AEDECOD"`   |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+
| `sex_scope`      | (`character`) Level of `SEX` to output in table.                                                                                                                                                                                                               | `"F"`         |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+
| `fmq_scope`      | (`character`) FMQ scope value to use in table.                                                                                                                                                                                                                 | `"NARROW"`    |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+
| `fmqsc_var`      | (`character`) FMQ scope variable to use in table.                                                                                                                                                                                                              | `"FMQ01SC"`   |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+
| `fmqnam_var`     | (`character`) FMQ reference name variable to use in table.                                                                                                                                                                                                     | `"FMQ01NAM"`  |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+
| `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`       |
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+
| `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_17.R).
:::
 
  • This website as well as code examples are licensed under the Apache License, Version 2.0.
Cookie Preferences