advs: 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
advs
(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 32subtitle: Percentage of Patients With Maximum Diastolic Blood Pressure by Category of Blood Pressure Postbaseline, Safety Population, Pooled Analysisformat: html---::: panel-tabset## Spec. Screenshot![](../assets/images/screenshots/table_32.png){fig-align="center" width="70%"}## rtables Table```{r tbl, message=FALSE, warning=FALSE}# 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_32(advs = advs, alt_counts_df = adsl, risk_diff = risk_diff)```## rtables Table Setup```{r tbl, eval=FALSE, echo=TRUE}```## Function Details### `make_table_32()`------------------------------------------------------------------------Required variables:- **`advs`**: `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** |+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+| `advs` | (`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/cardinal/blob/main/R/fda-table_32.R#L31).## gtsummary Table```{r tbl_gtsum, message=FALSE, warning=FALSE}# Load Libraries & Datalibrary(cardinal)adsl <- random.cdisc.data::cadsladvs <- random.cdisc.data::cadvs# Output tabletbl <- make_table_32_gtsum(advs = advs)tbl```## gtsummary Table Setup```{r tbl_gtsum, eval=FALSE, echo=TRUE}```## Function Details: `make_table_32_gtsum`### `make_table_32_gtsum()`------------------------------------------------------------------------Required variables:- **`advs`**: `USUBJID`, `AVISITN`, `PARAMCD`, `AVAL`, `AVALU`, and the variables specified by `arm_var` and `saffl_var`.| **Argument** | **Description** | **Default** ||:----------------|:-------------------------------------------------------------------------------------------------------------------|:---------------------|| `advs` | (`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` || `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. | `"Total Population"` |Source code for this function is available [here](https://github.com/pharmaverse/cardinal/blob/main/R/fda-table_32.R#L91).:::