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.
$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
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.
---title: FDA Table 33subtitle: Percentage of Patients Meeting Specific Hypotension Levels Postbaseline, Safety Population, Pooled Analysisformat: html---::: panel-tabset## Spec. Screenshot{fig-align="center" width="70%"}## gtsummary Table<details><summary>gtsummary Table Setup</summary>```{r tbl1, eval=FALSE, echo=TRUE}# Load Libraries & Datalibrary(cardinal)adsl <- random.cdisc.data::cadsladvs <- random.cdisc.data::cadvs# Output Tablemake_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 & Datalibrary(cardinal)adsl <- random.cdisc.data::cadsladvs <- random.cdisc.data::cadvs# Create Table & ARDresult <- make_table_33(df = advs, return_ard = TRUE)# Output ARDresult$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 & Datalibrary(cardinal)adsl <- random.cdisc.data::cadsladvs <- random.cdisc.data::cadvs# Output Tablerisk_diff <- list(arm_x = "B: Placebo", arm_y = "A: Drug X") # optionalmake_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>:::