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 33

Percentage of Patients Meeting Specific Hypotension Levels Postbaseline, Safety Population, Pooled Analysis

  • Spec. Screenshot
  • gtsummary Table
  • ARD
  • rtables Table

gtsummary Table Setup
# Load Libraries & Data
library(cardinal)

adsl <- random.cdisc.data::cadsl
advs <- random.cdisc.data::cadvs

# Output Table
make_table_33(df = advs, return_ard = FALSE)
Diastolic Blood Pressure (Pa) A: Drug X
N = 1341
B: Placebo
N = 1341
C: Combination
N = 1321
SBP <90 9 (6.7%) 24 (17.9%) 12 (9.1%)
DBP <60 10 (7.5%) 13 (9.7%) 14 (10.6%)
1 n (%)
Function Details

make_table_33()

  • df: USUBJID, AVISITN, PARAMCD, AVAL, AVALU, and the variables specified by arm_var and saffl_var.
  • denominator (if specified): USUBJID and the variables specified by arm_var and saffl_var.
  • If both the ARD (return_ard = "Y") and an overall column (lbl_overall not missing) are requested, a list of two ARDs will be returned: ard$tbl_summary for the table by groups, and ard$add_overall for the overal column.
Argument Description Default
df (data.frame) Dataset (typically ADVS) required to build table. No default
denominator (character) Alternative dataset (typically ADSL) used only to calculate column counts. NULL
return_ard (flag) Whether an ARD should be returned. TRUE
id_vars (character) Identifier required to count the number of events (typically calculated by USUBJID). "USUBJID"
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"
lbl_overall (character) If specified, an overall column will be added to the table with the given value as the column label. NULL
subset (character) If specified, the calculations will be done on the selected subset of df. NULL

Source code for this function is available here.


ARD Setup
# Load Libraries & Data
library(cardinal)

adsl <- random.cdisc.data::cadsl
advs <- random.cdisc.data::cadvs

# Create Table & ARD
result <- make_table_33(df = advs, return_ard = TRUE)

# Output ARD
result$ard
$tbl_summary
   group1 group1_level variable variable_level stat_name stat_label  stat
1     ARM    A: Drug X    SBP90           TRUE         n          n     9
2     ARM    A: Drug X    SBP90           TRUE         N          N   134
3     ARM    A: Drug X    SBP90           TRUE         p          % 0.067
4     ARM    A: Drug X    DBP60           TRUE         n          n    10
5     ARM    A: Drug X    DBP60           TRUE         N          N   134
6     ARM    A: Drug X    DBP60           TRUE         p          % 0.075
7     ARM    B: Place…    SBP90           TRUE         n          n    24
8     ARM    B: Place…    SBP90           TRUE         N          N   134
9     ARM    B: Place…    SBP90           TRUE         p          % 0.179
10    ARM    B: Place…    DBP60           TRUE         n          n    13
rtables Table Setup
# Load Libraries & Data
library(cardinal)

adsl <- random.cdisc.data::cadsl
advs <- random.cdisc.data::cadvs

# Output Table
risk_diff <- list(arm_x = "B: Placebo", arm_y = "A: Drug X") # optional
make_table_33_rtables(
  df = advs,
  alt_counts_df = adsl,
  risk_diff = risk_diff
)
Blood Pressure   A: Drug X   B: Placebo   C: Combination   Risk Difference (%) (95% CI)
(Pa)              (N=134)     (N=134)        (N=132)                 (N=268)           
———————————————————————————————————————————————————————————————————————————————————————
SBP <90          9 (6.7%)    24 (17.9%)     12 (9.1%)           11.2 (3.4 - 18.9)      
DBP <60          10 (7.5%)   13 (9.7%)      14 (10.6%)           2.2 (-4.5 - 8.9)      
Function Details

make_table_33_rtables()


Required variables:

  • df: USUBJID, AVISITN, PARAMCD, AVAL, AVALU, and the variables specified by arm_var and saffl_var.
  • alt_counts_df (if specified): USUBJID and the variables specified by arm_var and saffl_var.
Argument Description Default
df (data.frame) Dataset (typically ADVS) required to build table. No default
alt_counts_df (character) Alternative dataset (typically ADSL) 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"
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
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 33
subtitle: Percentage of Patients Meeting Specific Hypotension Levels Postbaseline, Safety Population, Pooled Analysis
format: html
---

::: panel-tabset
## Spec. Screenshot

![](../assets/images/screenshots/table_33.png){fig-align="center" width="70%"}

## gtsummary Table

<details>

<summary>gtsummary Table Setup</summary>

```{r tbl1, eval=FALSE, echo=TRUE}
# Load Libraries & Data
library(cardinal)

adsl <- random.cdisc.data::cadsl
advs <- random.cdisc.data::cadvs

# Output Table
make_table_33(df = advs, return_ard = FALSE)
```

</details>

```{r tbl1, message=FALSE, warning=FALSE, eval=TRUE}
```

<details>

<summary>Function Details</summary>

### `make_table_33()`

-   **`df`**: `USUBJID`, `AVISITN`, `PARAMCD`, `AVAL`, `AVALU`, and the variables specified by `arm_var` and `saffl_var`.
-   **`denominator`** (if specified): `USUBJID` and the variables specified by `arm_var` and `saffl_var`.
-   If both the ARD (`return_ard = "Y"`) and an overall column (`lbl_overall` not missing) are requested, a list of two ARDs will be returned: `ard$tbl_summary` for the table by groups, and `ard$add_overall` for the overal column.

+---------------+--------------------------------------------------------------------------------------------------------------------+--------------+
| **Argument**  | **Description**                                                                                                    | **Default**  |
+:==============+:===================================================================================================================+:=============+
| `df`          | (`data.frame`) Dataset (typically ADVS) required to build table.                                                   | *No default* |
+---------------+--------------------------------------------------------------------------------------------------------------------+--------------+
| `denominator` | (`character`) Alternative dataset (typically ADSL) used only to calculate column counts.                           | `NULL`       |
+---------------+--------------------------------------------------------------------------------------------------------------------+--------------+
| `return_ard`  | (`flag`) Whether an ARD should be returned.                                                                        | `TRUE`       |
+---------------+--------------------------------------------------------------------------------------------------------------------+--------------+
| `id_vars`     | (`character`) Identifier required to count the number of events (typically calculated by USUBJID).                 | `"USUBJID"`  |
+---------------+--------------------------------------------------------------------------------------------------------------------+--------------+
| `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"`    |
+---------------+--------------------------------------------------------------------------------------------------------------------+--------------+
| `lbl_overall` | (`character`) If specified, an overall column will be added to the table with the given value as the column label. | `NULL`       |
+---------------+--------------------------------------------------------------------------------------------------------------------+--------------+
| `subset`      | (`character`) If specified, the calculations will be done on the selected subset of `df`.                          | `NULL`       |
+---------------+--------------------------------------------------------------------------------------------------------------------+--------------+

Source code for this function is available [here](https://github.com/pharmaverse/cardinal/blob/main/R/fda-table_05.R).

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

</details>

## ARD

<details>

<summary>ARD Setup</summary>

```{r tbl2, eval=FALSE, echo=TRUE}
# Load Libraries & Data
library(cardinal)

adsl <- random.cdisc.data::cadsl
advs <- random.cdisc.data::cadvs

# Create Table & ARD
result <- make_table_33(df = advs, return_ard = TRUE)

# Output ARD
result$ard
```

</details>

```{r tbl2, message=FALSE, warning=FALSE, eval=TRUE}
```

## rtables Table

<details>

<summary>rtables Table Setup</summary>

```{r tbl3, eval=FALSE, echo=TRUE}
# Load Libraries & Data
library(cardinal)

adsl <- random.cdisc.data::cadsl
advs <- random.cdisc.data::cadvs

# Output Table
risk_diff <- list(arm_x = "B: Placebo", arm_y = "A: Drug X") # optional
make_table_33_rtables(
  df = advs,
  alt_counts_df = adsl,
  risk_diff = risk_diff
)
```

</details>

```{r tbl3, message=FALSE, warning=FALSE, eval=TRUE}
```

<details>

<summary>Function Details</summary>

### `make_table_33_rtables()`

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

Required variables:

-   **`df`**: `USUBJID`, `AVISITN`, `PARAMCD`, `AVAL`, `AVALU`, and the variables specified by `arm_var` and `saffl_var`.
-   **`alt_counts_df`** (if specified): `USUBJID` and the variables specified by `arm_var` and `saffl_var`.

+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+
| Argument         | Description                                                                                                                                                                                                                                                  | Default      |
+:=================+:=============================================================================================================================================================================================================================================================+:=============+
| `df`             | (`data.frame`) Dataset (typically ADVS) required to build table.                                                                                                                                                                                             | *No default* |
+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+
| `alt_counts_df`  | (`character`) Alternative dataset (typically ADSL) 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"`    |
+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+
| `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`      |
+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+
| `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/falcon/blob/main/R/fda-table_33.R).

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