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

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

FDA Table 36

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 36 ---------------------------------------------------------------
# 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",
    # systolic blood pressure
    PARAMCD == "SYSBP",
    # post-baseline visits
    AVISITN >= 2
  ) |>
  # analyze maximum values of each subject
  slice_max(AVAL, n = 1L, by = USUBJID) |>
  # define analysis value cutoffs
  mutate(
    L90 = AVAL < 90,
    GE90 = AVAL >= 90,
    GE120 = AVAL >= 120,
    GE140 = AVAL >= 140,
    GE160 = AVAL >= 160,
    GE180 = AVAL >= 180
  )

ard <- bind_ard(
  ard_tabulate_value(
    data,
    variables = c(L90, GE90, GE120, GE140, GE160, GE180),
    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(
    L90 = "<90",
    GE90 = ">=90",
    GE120 = ">=120",
    GE140 = ">=140",
    GE160 = ">=160",
    GE180 = ">=180"
  )
) |>
  modify_header(
    # Update label, add analysis value units
    label ~ paste0("**Systolic 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
Systolic Blood Pressure (mmHg) Placebo
N = 861
Xanomeline High Dose
N = 721
Xanomeline Low Dose
N = 961
<90 0 (0.0%) 0 (0.0%) 0 (0.0%)
>=90 135 (160.7%) 109 (151.4%) 134 (142.6%)
>=120 131 (156.0%) 108 (150.0%) 132 (140.4%)
>=140 101 (120.2%) 69 (95.8%) 105 (111.7%)
>=160 49 (58.3%) 24 (33.3%) 50 (53.2%)
>=180 6 (7.1%) 4 (5.6%) 9 (9.6%)
1 n (%)
Code
withr::local_options(width = 9999, tibble.print_max = Inf)
print(ard, columns = "all")
$tbl_ard_summary
# An ARD data frame: 57 × 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              L90      TRUE                 tabulate_value n         n              0          0       <NULL>  <NULL> stat_1    
 2 TRT01A Placebo              L90      TRUE                 tabulate_value p         %              0          <fn>    <NULL>  <NULL> stat_1    
 3 TRT01A Placebo              GE90     TRUE                 tabulate_value n         n              135        0       <NULL>  <NULL> stat_1    
 4 TRT01A Placebo              GE90     TRUE                 tabulate_value p         %              1.607143   <fn>    <NULL>  <NULL> stat_1    
 5 TRT01A Placebo              GE120    TRUE                 tabulate_value n         n              131        0       <NULL>  <NULL> stat_1    
 6 TRT01A Placebo              GE120    TRUE                 tabulate_value p         %              1.559524   <fn>    <NULL>  <NULL> stat_1    
 7 TRT01A Placebo              GE140    TRUE                 tabulate_value n         n              101        0       <NULL>  <NULL> stat_1    
 8 TRT01A Placebo              GE140    TRUE                 tabulate_value p         %              1.202381   <fn>    <NULL>  <NULL> stat_1    
 9 TRT01A Placebo              GE160    TRUE                 tabulate_value n         n              49         0       <NULL>  <NULL> stat_1    
10 TRT01A Placebo              GE160    TRUE                 tabulate_value p         %              0.5833333  <fn>    <NULL>  <NULL> stat_1    
11 TRT01A Placebo              GE180    TRUE                 tabulate_value n         n              6          0       <NULL>  <NULL> stat_1    
12 TRT01A Placebo              GE180    TRUE                 tabulate_value p         %              0.07142857 <fn>    <NULL>  <NULL> stat_1    
13 TRT01A Xanomeline High Dose L90      TRUE                 tabulate_value n         n              0          0       <NULL>  <NULL> stat_2    
14 TRT01A Xanomeline High Dose L90      TRUE                 tabulate_value p         %              0          <fn>    <NULL>  <NULL> stat_2    
15 TRT01A Xanomeline High Dose GE90     TRUE                 tabulate_value n         n              109        0       <NULL>  <NULL> stat_2    
16 TRT01A Xanomeline High Dose GE90     TRUE                 tabulate_value p         %              1.513889   <fn>    <NULL>  <NULL> stat_2    
17 TRT01A Xanomeline High Dose GE120    TRUE                 tabulate_value n         n              108        0       <NULL>  <NULL> stat_2    
18 TRT01A Xanomeline High Dose GE120    TRUE                 tabulate_value p         %              1.5        <fn>    <NULL>  <NULL> stat_2    
19 TRT01A Xanomeline High Dose GE140    TRUE                 tabulate_value n         n              69         0       <NULL>  <NULL> stat_2    
20 TRT01A Xanomeline High Dose GE140    TRUE                 tabulate_value p         %              0.9583333  <fn>    <NULL>  <NULL> stat_2    
21 TRT01A Xanomeline High Dose GE160    TRUE                 tabulate_value n         n              24         0       <NULL>  <NULL> stat_2    
22 TRT01A Xanomeline High Dose GE160    TRUE                 tabulate_value p         %              0.3333333  <fn>    <NULL>  <NULL> stat_2    
23 TRT01A Xanomeline High Dose GE180    TRUE                 tabulate_value n         n              4          0       <NULL>  <NULL> stat_2    
24 TRT01A Xanomeline High Dose GE180    TRUE                 tabulate_value p         %              0.05555556 <fn>    <NULL>  <NULL> stat_2    
25 TRT01A Xanomeline Low Dose  L90      TRUE                 tabulate_value n         n              0          0       <NULL>  <NULL> stat_3    
26 TRT01A Xanomeline Low Dose  L90      TRUE                 tabulate_value p         %              0          <fn>    <NULL>  <NULL> stat_3    
27 TRT01A Xanomeline Low Dose  GE90     TRUE                 tabulate_value n         n              134        0       <NULL>  <NULL> stat_3    
28 TRT01A Xanomeline Low Dose  GE90     TRUE                 tabulate_value p         %              1.425532   <fn>    <NULL>  <NULL> stat_3    
29 TRT01A Xanomeline Low Dose  GE120    TRUE                 tabulate_value n         n              132        0       <NULL>  <NULL> stat_3    
30 TRT01A Xanomeline Low Dose  GE120    TRUE                 tabulate_value p         %              1.404255   <fn>    <NULL>  <NULL> stat_3    
31 TRT01A Xanomeline Low Dose  GE140    TRUE                 tabulate_value n         n              105        0       <NULL>  <NULL> stat_3    
32 TRT01A Xanomeline Low Dose  GE140    TRUE                 tabulate_value p         %              1.117021   <fn>    <NULL>  <NULL> stat_3    
33 TRT01A Xanomeline Low Dose  GE160    TRUE                 tabulate_value n         n              50         0       <NULL>  <NULL> stat_3    
34 TRT01A Xanomeline Low Dose  GE160    TRUE                 tabulate_value p         %              0.5319149  <fn>    <NULL>  <NULL> stat_3    
35 TRT01A Xanomeline Low Dose  GE180    TRUE                 tabulate_value n         n              9          0       <NULL>  <NULL> stat_3    
36 TRT01A Xanomeline Low Dose  GE180    TRUE                 tabulate_value p         %              0.09574468 <fn>    <NULL>  <NULL> stat_3    
37 <NA>   <NULL>               TRT01A   Placebo              tabulate       n         n              86         0       <NULL>  <NULL> <NA>      
38 <NA>   <NULL>               TRT01A   Placebo              tabulate       N         N              254        0       <NULL>  <NULL> <NA>      
39 <NA>   <NULL>               TRT01A   Placebo              tabulate       p         %              0.3385827  <fn>    <NULL>  <NULL> <NA>      
40 <NA>   <NULL>               TRT01A   Xanomeline High Dose tabulate       n         n              72         0       <NULL>  <NULL> <NA>      
41 <NA>   <NULL>               TRT01A   Xanomeline High Dose tabulate       N         N              254        0       <NULL>  <NULL> <NA>      
42 <NA>   <NULL>               TRT01A   Xanomeline High Dose tabulate       p         %              0.2834646  <fn>    <NULL>  <NULL> <NA>      
43 <NA>   <NULL>               TRT01A   Xanomeline Low Dose  tabulate       n         n              96         0       <NULL>  <NULL> <NA>      
44 <NA>   <NULL>               TRT01A   Xanomeline Low Dose  tabulate       N         N              254        0       <NULL>  <NULL> <NA>      
45 <NA>   <NULL>               TRT01A   Xanomeline Low Dose  tabulate       p         %              0.3779528  <fn>    <NULL>  <NULL> <NA>      
46 <NA>   <NULL>               L90      <NULL>               attributes     label     Variable Label <90        <fn>    <NULL>  <NULL> <NA>      
47 <NA>   <NULL>               L90      <NULL>               attributes     class     Variable Class logical    <NULL>  <NULL>  <NULL> <NA>      
48 <NA>   <NULL>               GE90     <NULL>               attributes     label     Variable Label >=90       <fn>    <NULL>  <NULL> <NA>      
49 <NA>   <NULL>               GE90     <NULL>               attributes     class     Variable Class logical    <NULL>  <NULL>  <NULL> <NA>      
50 <NA>   <NULL>               GE120    <NULL>               attributes     label     Variable Label >=120      <fn>    <NULL>  <NULL> <NA>      
51 <NA>   <NULL>               GE120    <NULL>               attributes     class     Variable Class logical    <NULL>  <NULL>  <NULL> <NA>      
52 <NA>   <NULL>               GE140    <NULL>               attributes     label     Variable Label >=140      <fn>    <NULL>  <NULL> <NA>      
53 <NA>   <NULL>               GE140    <NULL>               attributes     class     Variable Class logical    <NULL>  <NULL>  <NULL> <NA>      
54 <NA>   <NULL>               GE160    <NULL>               attributes     label     Variable Label >=160      <fn>    <NULL>  <NULL> <NA>      
55 <NA>   <NULL>               GE160    <NULL>               attributes     class     Variable Class logical    <NULL>  <NULL>  <NULL> <NA>      
56 <NA>   <NULL>               GE180    <NULL>               attributes     label     Variable Label >=180      <fn>    <NULL>  <NULL> <NA>      
57 <NA>   <NULL>               GE180    <NULL>               attributes     class     Variable Class logical    <NULL>  <NULL>  <NULL> <NA>      
Source Code
---
title: Subjects With Maximum Postbaseline Systolic Blood Pressure by Category of Blood Pressure, Safety Population, Pooled Analysis (or Trial X)
subtitle: FDA Table 36
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_36.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