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

Subjects With Maximum Postbaseline Diastolic Blood Pressure by Category of Blood Pressure, Safety Population, Pooled Analysis (or Trial X)

FDA Table 37

table
FDA
safety
vital signs

FDA IG Shell

FDA IG example table shell

Programming Notes

Background and Instructions

Subject counts are cumulative for each abnormality threshold.

Customization

Clinical review team may customize the cutoff criteria they wish to use.

Output

  • Full Code
  • Table
  • ARD
Code
# FDA TABLE 37 ---------------------------------------------------------------
# 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
advs <- pharmaverseadam::advs

# Pre-processing --------------------------------------------
adsl <- adsl |>
  filter(SAFFL == "Y") # safety population

data <- advs |>
  filter(
    # safety population
    SAFFL == "Y",
    # diastolic blood pressure
    PARAMCD == "DIABP",
    # post-baseline visits
    AVISITN >= 2
  ) |>
  # analyze maximum values of each subject
  slice_max(AVAL, n = 1L, by = USUBJID) |>
  # define analysis value cutoffs
  mutate(
    L60 = AVAL < 60,
    G60 = AVAL > 60,
    G90 = AVAL > 90,
    G110 = AVAL > 110,
    GE120 = AVAL >= 120
  )

ard <- bind_ard(
  ard_tabulate_value(
    data,
    variables = c(L60, G60, G90, G110, GE120),
    by = TRT01A,
    statistic = ~ c("n", "p"),
    # denominator values are number of subjects in arm with BP data
    denominator = data |> distinct(USUBJID, TRT01A)
  ),
  # ARD for header N values
  ard_tabulate(adsl, variables = TRT01A)
)

tbl <- tbl_ard_summary(
  ard,
  by = TRT01A,
  # Add labels for each range
  label = list(
    L60 = "<60",
    G60 = ">60",
    G90 = ">90",
    G110 = ">110",
    GE120 = ">=120"
  )
) |>
  modify_header(
    # Update label, add analysis value units
    label ~ paste0("**Diastolic Blood Pressure (", data$VSORRESU[1], ")**"),
    # Add N values to `by` variable labels
    all_stat_cols() ~ "**{level}**  \nN = {n}"
  )


ard <- gtsummary::gather_ard(tbl)
Code
tbl
Diastolic Blood Pressure (mmHg) Placebo
N = 861
Xanomeline High Dose
N = 721
Xanomeline Low Dose
N = 961
<60 1 (1.2%) 0 (0.0%) 0 (0.0%)
>60 151 (179.8%) 152 (211.1%) 154 (163.8%)
>90 36 (42.9%) 29 (40.3%) 29 (30.9%)
>110 1 (1.2%) 0 (0.0%) 1 (1.1%)
>=120 0 (0.0%) 0 (0.0%) 0 (0.0%)
1 n (%)
Code
withr::local_options(width = 9999, tibble.print_max = Inf)
print(ard, columns = "all")
$tbl_ard_summary
# An ARD data frame: 49 × 12
   group1 group1_level         variable variable_level       context        stat_name stat_label     stat       fmt_fun warning error  gts_column
   <chr>  <list>               <chr>    <list>               <chr>          <chr>     <chr>          <list>     <list>  <list>  <list> <chr>     
 1 TRT01A Placebo              L60      TRUE                 tabulate_value n         n              1          0       <NULL>  <NULL> stat_1    
 2 TRT01A Placebo              L60      TRUE                 tabulate_value p         %              0.01190476 <fn>    <NULL>  <NULL> stat_1    
 3 TRT01A Placebo              G60      TRUE                 tabulate_value n         n              151        0       <NULL>  <NULL> stat_1    
 4 TRT01A Placebo              G60      TRUE                 tabulate_value p         %              1.797619   <fn>    <NULL>  <NULL> stat_1    
 5 TRT01A Placebo              G90      TRUE                 tabulate_value n         n              36         0       <NULL>  <NULL> stat_1    
 6 TRT01A Placebo              G90      TRUE                 tabulate_value p         %              0.4285714  <fn>    <NULL>  <NULL> stat_1    
 7 TRT01A Placebo              G110     TRUE                 tabulate_value n         n              1          0       <NULL>  <NULL> stat_1    
 8 TRT01A Placebo              G110     TRUE                 tabulate_value p         %              0.01190476 <fn>    <NULL>  <NULL> stat_1    
 9 TRT01A Placebo              GE120    TRUE                 tabulate_value n         n              0          0       <NULL>  <NULL> stat_1    
10 TRT01A Placebo              GE120    TRUE                 tabulate_value p         %              0          <fn>    <NULL>  <NULL> stat_1    
11 TRT01A Xanomeline High Dose L60      TRUE                 tabulate_value n         n              0          0       <NULL>  <NULL> stat_2    
12 TRT01A Xanomeline High Dose L60      TRUE                 tabulate_value p         %              0          <fn>    <NULL>  <NULL> stat_2    
13 TRT01A Xanomeline High Dose G60      TRUE                 tabulate_value n         n              152        0       <NULL>  <NULL> stat_2    
14 TRT01A Xanomeline High Dose G60      TRUE                 tabulate_value p         %              2.111111   <fn>    <NULL>  <NULL> stat_2    
15 TRT01A Xanomeline High Dose G90      TRUE                 tabulate_value n         n              29         0       <NULL>  <NULL> stat_2    
16 TRT01A Xanomeline High Dose G90      TRUE                 tabulate_value p         %              0.4027778  <fn>    <NULL>  <NULL> stat_2    
17 TRT01A Xanomeline High Dose G110     TRUE                 tabulate_value n         n              0          0       <NULL>  <NULL> stat_2    
18 TRT01A Xanomeline High Dose G110     TRUE                 tabulate_value p         %              0          <fn>    <NULL>  <NULL> stat_2    
19 TRT01A Xanomeline High Dose GE120    TRUE                 tabulate_value n         n              0          0       <NULL>  <NULL> stat_2    
20 TRT01A Xanomeline High Dose GE120    TRUE                 tabulate_value p         %              0          <fn>    <NULL>  <NULL> stat_2    
21 TRT01A Xanomeline Low Dose  L60      TRUE                 tabulate_value n         n              0          0       <NULL>  <NULL> stat_3    
22 TRT01A Xanomeline Low Dose  L60      TRUE                 tabulate_value p         %              0          <fn>    <NULL>  <NULL> stat_3    
23 TRT01A Xanomeline Low Dose  G60      TRUE                 tabulate_value n         n              154        0       <NULL>  <NULL> stat_3    
24 TRT01A Xanomeline Low Dose  G60      TRUE                 tabulate_value p         %              1.638298   <fn>    <NULL>  <NULL> stat_3    
25 TRT01A Xanomeline Low Dose  G90      TRUE                 tabulate_value n         n              29         0       <NULL>  <NULL> stat_3    
26 TRT01A Xanomeline Low Dose  G90      TRUE                 tabulate_value p         %              0.3085106  <fn>    <NULL>  <NULL> stat_3    
27 TRT01A Xanomeline Low Dose  G110     TRUE                 tabulate_value n         n              1          0       <NULL>  <NULL> stat_3    
28 TRT01A Xanomeline Low Dose  G110     TRUE                 tabulate_value p         %              0.0106383  <fn>    <NULL>  <NULL> stat_3    
29 TRT01A Xanomeline Low Dose  GE120    TRUE                 tabulate_value n         n              0          0       <NULL>  <NULL> stat_3    
30 TRT01A Xanomeline Low Dose  GE120    TRUE                 tabulate_value p         %              0          <fn>    <NULL>  <NULL> stat_3    
31 <NA>   <NULL>               TRT01A   Placebo              tabulate       n         n              86         0       <NULL>  <NULL> <NA>      
32 <NA>   <NULL>               TRT01A   Placebo              tabulate       N         N              254        0       <NULL>  <NULL> <NA>      
33 <NA>   <NULL>               TRT01A   Placebo              tabulate       p         %              0.3385827  <fn>    <NULL>  <NULL> <NA>      
34 <NA>   <NULL>               TRT01A   Xanomeline High Dose tabulate       n         n              72         0       <NULL>  <NULL> <NA>      
35 <NA>   <NULL>               TRT01A   Xanomeline High Dose tabulate       N         N              254        0       <NULL>  <NULL> <NA>      
36 <NA>   <NULL>               TRT01A   Xanomeline High Dose tabulate       p         %              0.2834646  <fn>    <NULL>  <NULL> <NA>      
37 <NA>   <NULL>               TRT01A   Xanomeline Low Dose  tabulate       n         n              96         0       <NULL>  <NULL> <NA>      
38 <NA>   <NULL>               TRT01A   Xanomeline Low Dose  tabulate       N         N              254        0       <NULL>  <NULL> <NA>      
39 <NA>   <NULL>               TRT01A   Xanomeline Low Dose  tabulate       p         %              0.3779528  <fn>    <NULL>  <NULL> <NA>      
40 <NA>   <NULL>               L60      <NULL>               attributes     label     Variable Label <60        <fn>    <NULL>  <NULL> <NA>      
41 <NA>   <NULL>               L60      <NULL>               attributes     class     Variable Class logical    <NULL>  <NULL>  <NULL> <NA>      
42 <NA>   <NULL>               G60      <NULL>               attributes     label     Variable Label >60        <fn>    <NULL>  <NULL> <NA>      
43 <NA>   <NULL>               G60      <NULL>               attributes     class     Variable Class logical    <NULL>  <NULL>  <NULL> <NA>      
44 <NA>   <NULL>               G90      <NULL>               attributes     label     Variable Label >90        <fn>    <NULL>  <NULL> <NA>      
45 <NA>   <NULL>               G90      <NULL>               attributes     class     Variable Class logical    <NULL>  <NULL>  <NULL> <NA>      
46 <NA>   <NULL>               G110     <NULL>               attributes     label     Variable Label >110       <fn>    <NULL>  <NULL> <NA>      
47 <NA>   <NULL>               G110     <NULL>               attributes     class     Variable Class logical    <NULL>  <NULL>  <NULL> <NA>      
48 <NA>   <NULL>               GE120    <NULL>               attributes     label     Variable Label >=120      <fn>    <NULL>  <NULL> <NA>      
49 <NA>   <NULL>               GE120    <NULL>               attributes     class     Variable Class logical    <NULL>  <NULL>  <NULL> <NA>      
Source Code
---
title: Subjects With Maximum Postbaseline Diastolic Blood Pressure by Category of Blood Pressure, Safety Population, Pooled Analysis (or Trial X)
subtitle: FDA Table 37
categories: [table, FDA, safety, vital signs]
---

::::: 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**

Subject counts are cumulative for each abnormality threshold.

**Customization**

Clinical review team may customize the cutoff criteria they wish to use.

::::

:::: {.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_37.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