Cardinal
  • Home
  • Template Catalog
  • About
  • Resources
  • Help
    • Getting Started
    • Report a Bug
    • FAQ

Subjects With Adverse Events by Male-Specific OCMQ (Broad) and Preferred Term, Male Safety Population, Pooled Analysis (or Trial X)

FDA Table 44

table
FDA
safety
adverse events

FDA IG Shell

FDA IG example table shell

Programming Notes

Background and Instructions

As discussed in Section 3.2.3.3 Subjects With Adverse Events by Sex-Specific OND Custom Medical Queries (Narrow) and Preferred Term, some OCMQs are relevant to only one sex. Table 44: Adverse Events by Male Specific FDA Medical Query is limited to male-specific broad OCMQs and the male population. Table 45: Adverse Events by Female Specific FDA Medical Query is limited to female-specific broad OCMQs and the female population.

Customization

N/A (per FDA IG)

Output

  • Full Code
  • Table
  • ARD
Code
# FDA TABLE 44 ---------------------------------------------------------------
# Self-contained template. Run top-to-bottom to build the objects below.
# Used by tests via run_template() and published in the catalog.

library(dplyr)
library(cards)
library(gtsummary)

adsl <- pharmaverseadam::adsl
adae <- pharmaverseadam::adae

set.seed(1)
adae <- adae |>
  mutate(
    OCMQ01SC = as.factor(sample(c("BROAD", "NARROW"), nrow(adae), replace = TRUE)),
    OCMQ01NAM = if_else(
      SEX == "M",
      as.factor(sample(
        c("Erectile Dysfunction", "Gynecomastia"),
        n(),
        replace = TRUE
      )),
      NA_character_
    )
  )

# Pre-processing --------------------------------------------
data <- adae |>
  filter(
    SAFFL == "Y",
    SEX == "M",
    OCMQ01SC == "BROAD",
    # filtering here to reduce the size of the table
    AEDECOD %in% c("COUGH", "COLD SWEAT", "SOMNOLENCE", "APPLICATION SITE ERYTHEMA")
  ) |>
  select(OCMQ01SC, TRT01A, OCMQ01NAM, AEDECOD, USUBJID) |>
  # setting an explicit level for NA values so empty strata combinations are shown.
  mutate(across(everything(), ~ {
    if (anyNA(.)) {
      forcats::fct_na_value_to_level(as.factor(.), level = "<Missing>")
    } else {
      .
    }
  }))

# denominator values include only Male subjects in the arm with AEs
denom <- data |> distinct(USUBJID, TRT01A)

tbl <- data |>
  tbl_hierarchical(
    by = TRT01A,
    variables = c(OCMQ01NAM, AEDECOD),
    id = USUBJID,
    denominator = denom,
    # variables to calculate rates for
    include = c(AEDECOD),
    label = list(
      OCMQ01NAM ~ "OCMQ (Broad)",
      AEDECOD ~ "Preferred Term"
    )
  )


ard <- gtsummary::gather_ard(tbl)
Code
tbl
OCMQ (Broad)
    Preferred Term
Placebo
N = 31
Xanomeline High Dose
N = 81
Xanomeline Low Dose
N = 71
Erectile Dysfunction


    APPLICATION SITE ERYTHEMA 0 (0%) 3 (38%) 3 (43%)
    COUGH 1 (33%) 3 (38%) 0 (0%)
    SOMNOLENCE 0 (0%) 1 (13%) 1 (14%)
Gynecomastia


    APPLICATION SITE ERYTHEMA 0 (0%) 4 (50%) 4 (57%)
    COUGH 1 (33%) 1 (13%) 0 (0%)
    SOMNOLENCE 1 (33%) 0 (0%) 1 (14%)
1 n (%)
Code
withr::local_options(width = 9999, tibble.print_max = Inf)
print(ard, columns = "all")
$tbl_hierarchical
# An ARD data frame: 63 × 15
   group1 group1_level         group2    group2_level         variable variable_level            context      stat_name stat_label   stat stat_fmt fmt_fun warning error  gts_column
   <chr>  <list>               <chr>     <list>               <chr>    <list>                    <chr>        <chr>     <chr>      <list> <list>   <list>  <list>  <list> <chr>     
 1 <NA>   <NULL>               <NA>      <NULL>               TRT01A   Placebo                   tabulate     n         n           3     3        0       <NULL>  <NULL> stat_1    
 2 <NA>   <NULL>               <NA>      <NULL>               TRT01A   Placebo                   tabulate     N         N          18     18       0       <NULL>  <NULL> stat_1    
 3 <NA>   <NULL>               <NA>      <NULL>               TRT01A   Placebo                   tabulate     p         %           0.167 16.7     <fn>    <NULL>  <NULL> stat_1    
 4 <NA>   <NULL>               <NA>      <NULL>               TRT01A   Xanomeline High Dose      tabulate     n         n           8     8        0       <NULL>  <NULL> stat_2    
 5 <NA>   <NULL>               <NA>      <NULL>               TRT01A   Xanomeline High Dose      tabulate     N         N          18     18       0       <NULL>  <NULL> stat_2    
 6 <NA>   <NULL>               <NA>      <NULL>               TRT01A   Xanomeline High Dose      tabulate     p         %           0.444 44.4     <fn>    <NULL>  <NULL> stat_2    
 7 <NA>   <NULL>               <NA>      <NULL>               TRT01A   Xanomeline Low Dose       tabulate     n         n           7     7        0       <NULL>  <NULL> stat_3    
 8 <NA>   <NULL>               <NA>      <NULL>               TRT01A   Xanomeline Low Dose       tabulate     N         N          18     18       0       <NULL>  <NULL> stat_3    
 9 <NA>   <NULL>               <NA>      <NULL>               TRT01A   Xanomeline Low Dose       tabulate     p         %           0.389 38.9     <fn>    <NULL>  <NULL> stat_3    
10 TRT01A Placebo              OCMQ01NAM Erectile Dysfunction AEDECOD  APPLICATION SITE ERYTHEMA hierarchical n         n           0     0        <fn>    <NULL>  <NULL> stat_1    
11 TRT01A Placebo              OCMQ01NAM Erectile Dysfunction AEDECOD  APPLICATION SITE ERYTHEMA hierarchical N         N           3     3        <fn>    <NULL>  <NULL> stat_1    
12 TRT01A Placebo              OCMQ01NAM Erectile Dysfunction AEDECOD  APPLICATION SITE ERYTHEMA hierarchical p         %           0     0        <fn>    <NULL>  <NULL> stat_1    
13 TRT01A Xanomeline High Dose OCMQ01NAM Erectile Dysfunction AEDECOD  APPLICATION SITE ERYTHEMA hierarchical n         n           3     3        <fn>    <NULL>  <NULL> stat_2    
14 TRT01A Xanomeline High Dose OCMQ01NAM Erectile Dysfunction AEDECOD  APPLICATION SITE ERYTHEMA hierarchical N         N           8     8        <fn>    <NULL>  <NULL> stat_2    
15 TRT01A Xanomeline High Dose OCMQ01NAM Erectile Dysfunction AEDECOD  APPLICATION SITE ERYTHEMA hierarchical p         %           0.375 38       <fn>    <NULL>  <NULL> stat_2    
16 TRT01A Xanomeline Low Dose  OCMQ01NAM Erectile Dysfunction AEDECOD  APPLICATION SITE ERYTHEMA hierarchical n         n           3     3        <fn>    <NULL>  <NULL> stat_3    
17 TRT01A Xanomeline Low Dose  OCMQ01NAM Erectile Dysfunction AEDECOD  APPLICATION SITE ERYTHEMA hierarchical N         N           7     7        <fn>    <NULL>  <NULL> stat_3    
18 TRT01A Xanomeline Low Dose  OCMQ01NAM Erectile Dysfunction AEDECOD  APPLICATION SITE ERYTHEMA hierarchical p         %           0.429 43       <fn>    <NULL>  <NULL> stat_3    
19 TRT01A Placebo              OCMQ01NAM Erectile Dysfunction AEDECOD  COUGH                     hierarchical n         n           1     1        <fn>    <NULL>  <NULL> stat_1    
20 TRT01A Placebo              OCMQ01NAM Erectile Dysfunction AEDECOD  COUGH                     hierarchical N         N           3     3        <fn>    <NULL>  <NULL> stat_1    
21 TRT01A Placebo              OCMQ01NAM Erectile Dysfunction AEDECOD  COUGH                     hierarchical p         %           0.333 33       <fn>    <NULL>  <NULL> stat_1    
22 TRT01A Xanomeline High Dose OCMQ01NAM Erectile Dysfunction AEDECOD  COUGH                     hierarchical n         n           3     3        <fn>    <NULL>  <NULL> stat_2    
23 TRT01A Xanomeline High Dose OCMQ01NAM Erectile Dysfunction AEDECOD  COUGH                     hierarchical N         N           8     8        <fn>    <NULL>  <NULL> stat_2    
24 TRT01A Xanomeline High Dose OCMQ01NAM Erectile Dysfunction AEDECOD  COUGH                     hierarchical p         %           0.375 38       <fn>    <NULL>  <NULL> stat_2    
25 TRT01A Xanomeline Low Dose  OCMQ01NAM Erectile Dysfunction AEDECOD  COUGH                     hierarchical n         n           0     0        <fn>    <NULL>  <NULL> stat_3    
26 TRT01A Xanomeline Low Dose  OCMQ01NAM Erectile Dysfunction AEDECOD  COUGH                     hierarchical N         N           7     7        <fn>    <NULL>  <NULL> stat_3    
27 TRT01A Xanomeline Low Dose  OCMQ01NAM Erectile Dysfunction AEDECOD  COUGH                     hierarchical p         %           0     0        <fn>    <NULL>  <NULL> stat_3    
28 TRT01A Placebo              OCMQ01NAM Erectile Dysfunction AEDECOD  SOMNOLENCE                hierarchical n         n           0     0        <fn>    <NULL>  <NULL> stat_1    
29 TRT01A Placebo              OCMQ01NAM Erectile Dysfunction AEDECOD  SOMNOLENCE                hierarchical N         N           3     3        <fn>    <NULL>  <NULL> stat_1    
30 TRT01A Placebo              OCMQ01NAM Erectile Dysfunction AEDECOD  SOMNOLENCE                hierarchical p         %           0     0        <fn>    <NULL>  <NULL> stat_1    
31 TRT01A Xanomeline High Dose OCMQ01NAM Erectile Dysfunction AEDECOD  SOMNOLENCE                hierarchical n         n           1     1        <fn>    <NULL>  <NULL> stat_2    
32 TRT01A Xanomeline High Dose OCMQ01NAM Erectile Dysfunction AEDECOD  SOMNOLENCE                hierarchical N         N           8     8        <fn>    <NULL>  <NULL> stat_2    
33 TRT01A Xanomeline High Dose OCMQ01NAM Erectile Dysfunction AEDECOD  SOMNOLENCE                hierarchical p         %           0.125 13       <fn>    <NULL>  <NULL> stat_2    
34 TRT01A Xanomeline Low Dose  OCMQ01NAM Erectile Dysfunction AEDECOD  SOMNOLENCE                hierarchical n         n           1     1        <fn>    <NULL>  <NULL> stat_3    
35 TRT01A Xanomeline Low Dose  OCMQ01NAM Erectile Dysfunction AEDECOD  SOMNOLENCE                hierarchical N         N           7     7        <fn>    <NULL>  <NULL> stat_3    
36 TRT01A Xanomeline Low Dose  OCMQ01NAM Erectile Dysfunction AEDECOD  SOMNOLENCE                hierarchical p         %           0.143 14       <fn>    <NULL>  <NULL> stat_3    
37 TRT01A Placebo              OCMQ01NAM Gynecomastia         AEDECOD  APPLICATION SITE ERYTHEMA hierarchical n         n           0     0        <fn>    <NULL>  <NULL> stat_1    
38 TRT01A Placebo              OCMQ01NAM Gynecomastia         AEDECOD  APPLICATION SITE ERYTHEMA hierarchical N         N           3     3        <fn>    <NULL>  <NULL> stat_1    
39 TRT01A Placebo              OCMQ01NAM Gynecomastia         AEDECOD  APPLICATION SITE ERYTHEMA hierarchical p         %           0     0        <fn>    <NULL>  <NULL> stat_1    
40 TRT01A Xanomeline High Dose OCMQ01NAM Gynecomastia         AEDECOD  APPLICATION SITE ERYTHEMA hierarchical n         n           4     4        <fn>    <NULL>  <NULL> stat_2    
41 TRT01A Xanomeline High Dose OCMQ01NAM Gynecomastia         AEDECOD  APPLICATION SITE ERYTHEMA hierarchical N         N           8     8        <fn>    <NULL>  <NULL> stat_2    
42 TRT01A Xanomeline High Dose OCMQ01NAM Gynecomastia         AEDECOD  APPLICATION SITE ERYTHEMA hierarchical p         %           0.5   50       <fn>    <NULL>  <NULL> stat_2    
43 TRT01A Xanomeline Low Dose  OCMQ01NAM Gynecomastia         AEDECOD  APPLICATION SITE ERYTHEMA hierarchical n         n           4     4        <fn>    <NULL>  <NULL> stat_3    
44 TRT01A Xanomeline Low Dose  OCMQ01NAM Gynecomastia         AEDECOD  APPLICATION SITE ERYTHEMA hierarchical N         N           7     7        <fn>    <NULL>  <NULL> stat_3    
45 TRT01A Xanomeline Low Dose  OCMQ01NAM Gynecomastia         AEDECOD  APPLICATION SITE ERYTHEMA hierarchical p         %           0.571 57       <fn>    <NULL>  <NULL> stat_3    
46 TRT01A Placebo              OCMQ01NAM Gynecomastia         AEDECOD  COUGH                     hierarchical n         n           1     1        <fn>    <NULL>  <NULL> stat_1    
47 TRT01A Placebo              OCMQ01NAM Gynecomastia         AEDECOD  COUGH                     hierarchical N         N           3     3        <fn>    <NULL>  <NULL> stat_1    
48 TRT01A Placebo              OCMQ01NAM Gynecomastia         AEDECOD  COUGH                     hierarchical p         %           0.333 33       <fn>    <NULL>  <NULL> stat_1    
49 TRT01A Xanomeline High Dose OCMQ01NAM Gynecomastia         AEDECOD  COUGH                     hierarchical n         n           1     1        <fn>    <NULL>  <NULL> stat_2    
50 TRT01A Xanomeline High Dose OCMQ01NAM Gynecomastia         AEDECOD  COUGH                     hierarchical N         N           8     8        <fn>    <NULL>  <NULL> stat_2    
51 TRT01A Xanomeline High Dose OCMQ01NAM Gynecomastia         AEDECOD  COUGH                     hierarchical p         %           0.125 13       <fn>    <NULL>  <NULL> stat_2    
52 TRT01A Xanomeline Low Dose  OCMQ01NAM Gynecomastia         AEDECOD  COUGH                     hierarchical n         n           0     0        <fn>    <NULL>  <NULL> stat_3    
53 TRT01A Xanomeline Low Dose  OCMQ01NAM Gynecomastia         AEDECOD  COUGH                     hierarchical N         N           7     7        <fn>    <NULL>  <NULL> stat_3    
54 TRT01A Xanomeline Low Dose  OCMQ01NAM Gynecomastia         AEDECOD  COUGH                     hierarchical p         %           0     0        <fn>    <NULL>  <NULL> stat_3    
55 TRT01A Placebo              OCMQ01NAM Gynecomastia         AEDECOD  SOMNOLENCE                hierarchical n         n           1     1        <fn>    <NULL>  <NULL> stat_1    
56 TRT01A Placebo              OCMQ01NAM Gynecomastia         AEDECOD  SOMNOLENCE                hierarchical N         N           3     3        <fn>    <NULL>  <NULL> stat_1    
57 TRT01A Placebo              OCMQ01NAM Gynecomastia         AEDECOD  SOMNOLENCE                hierarchical p         %           0.333 33       <fn>    <NULL>  <NULL> stat_1    
58 TRT01A Xanomeline High Dose OCMQ01NAM Gynecomastia         AEDECOD  SOMNOLENCE                hierarchical n         n           0     0        <fn>    <NULL>  <NULL> stat_2    
59 TRT01A Xanomeline High Dose OCMQ01NAM Gynecomastia         AEDECOD  SOMNOLENCE                hierarchical N         N           8     8        <fn>    <NULL>  <NULL> stat_2    
60 TRT01A Xanomeline High Dose OCMQ01NAM Gynecomastia         AEDECOD  SOMNOLENCE                hierarchical p         %           0     0        <fn>    <NULL>  <NULL> stat_2    
61 TRT01A Xanomeline Low Dose  OCMQ01NAM Gynecomastia         AEDECOD  SOMNOLENCE                hierarchical n         n           1     1        <fn>    <NULL>  <NULL> stat_3    
62 TRT01A Xanomeline Low Dose  OCMQ01NAM Gynecomastia         AEDECOD  SOMNOLENCE                hierarchical N         N           7     7        <fn>    <NULL>  <NULL> stat_3    
63 TRT01A Xanomeline Low Dose  OCMQ01NAM Gynecomastia         AEDECOD  SOMNOLENCE                hierarchical p         %           0.143 14       <fn>    <NULL>  <NULL> stat_3    
Source Code
---
title: Subjects With Adverse Events by Male-Specific OCMQ (Broad) and Preferred Term, Male Safety Population, Pooled Analysis (or Trial X)
subtitle: FDA Table 44
categories: [table, FDA, safety, adverse events]
---

::::: columns

:::: {.column width="52%"}
### FDA IG Shell

![](ig_shell.png){fig-alt="FDA IG example table shell" .lightbox width=100%}

### Programming Notes

**Background and Instructions**

As discussed in Section 3.2.3.3 Subjects With Adverse Events by Sex-Specific OND Custom Medical Queries (Narrow) and Preferred Term, some OCMQs are relevant to only one sex. Table 44: Adverse Events by Male Specific FDA Medical Query is limited to male-specific broad OCMQs and the male population. Table 45: Adverse Events by Female Specific FDA Medical Query is limited to female-specific broad OCMQs and the female population.

**Customization**

[N/A (per FDA IG)](https://www.fda.gov/media/187065/download)

::::

:::: {.column width="4%"}
::::

:::: {.column width="44%"}
### Output

```{r out-result, echo=FALSE, fig.align='center', out.width='100%'}
knitr::include_graphics("result.png")
```

::::

:::::

::: panel-tabset
## Full Code

```{r fullcode, file="../../../inst/templates/fda-table_44.R", message=FALSE, warning=FALSE, results='hide'}
```

## Table

```{r tbl}
tbl
```

## ARD

```{r ard, message=FALSE, warning=FALSE}
withr::local_options(width = 9999, tibble.print_max = Inf)
print(ard, columns = "all")
```

:::
 
  • This website as well as code examples are licensed under the Apache License, Version 2.0.
Cookie Preferences