A: Drug X B: Placebo C: Combination
Characteristic (N=134) (N=134) (N=132)
————————————————————————————————————————————————————————————————————————————————————————
Any AE, n (%) 122 (91.0%) 123 (91.8%) 120 (90.9%)
SEX, n (%)
F 72 (91.1%) 77 (93.9%) 65 (92.9%)
M 50 (90.9%) 46 (88.5%) 55 (88.7%)
Age Group, years, n (%)
>=17 to <65 122 (91%) 123 (91.8%) 119 (90.8%)
>=65 0 0 1 (100%)
RACE, n (%)
ASIAN 61 (89.7%) 62 (92.5%) 63 (86.3%)
BLACK OR AFRICAN AMERICAN 28 (90.3%) 24 (85.7%) 31 (96.9%)
WHITE 26 (96.3%) 25 (96.2%) 21 (100%)
AMERICAN INDIAN OR ALASKA NATIVE 7 (87.5%) 10 (90.9%) 5 (83.3%)
MULTIPLE 0 1 (100%) 0
NATIVE HAWAIIAN OR OTHER PACIFIC ISLANDER 0 1 (100%) 0
OTHER 0 0 0
UNKNOWN 0 0 0
ETHNIC, n (%)
HISPANIC OR LATINO 13 (86.7%) 17 (94.4%) 13 (86.7%)
NOT HISPANIC OR LATINO 95 (91.3%) 94 (91.3%) 93 (92.1%)
NOT REPORTED 6 (100%) 10 (100%) 10 (90.9%)
UNKNOWN 8 (88.9%) 2 (66.7%) 4 (80%)
FDA Table 22
Overview of Adverse Events1 by Demographic Subgroup, Safety Population, Pooled Analysis (or Trial X)
# Load Libraries & Data
library(dplyr)
library(cardinal)
adsl <- random.cdisc.data::cadsl %>%
mutate(AGEGR1 = as.factor(case_when(
AGE >= 17 & AGE < 65 ~ ">=17 to <65",
AGE >= 65 ~ ">=65",
AGE >= 65 & AGE < 75 ~ ">=65 to <75",
AGE >= 75 ~ ">=75"
)) %>% formatters::with_label("Age Group, years")) %>%
formatters::var_relabel(AGE = "Age, years")
adae <- random.cdisc.data::cadae
df <- left_join(adsl, adae, by = intersect(names(adsl), names(adae)))
# Output Table
make_table_22(df = df, alt_counts_df = adsl, denom = "N_s")
make_table_22()
Required variables:
-
df
:USUBJID
, and the variables specified byarm_var
andsaffl_var
. -
alt_counts_df
(if specified):USUBJID
and the variables specified byarm_var
andsaffl_var
.
make_table_22()
inherits from cardinal::a_count_occurrences_ser_ae()
function.
Argument | Description | Default |
---|---|---|
df |
(data.frame ) Dataset (typically ADSL) required to build table. |
No default |
alt_counts_df |
(character ) Alternative dataset 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" |
vars |
(character ) Variables from df to include in the table. |
c("SEX", "AGE", "AGEGR1", "RACE", "ETHNIC", "COUNTRY") |
denom |
(character ) Denominator choice (N_col to get the total column, n to have the total number of “Any AE” in the column, or N_s to have the total number of participants of the category in the column as denominator). |
c("N_s", "N_col", "n") |
lbl_vars |
(character ) Labels corresponding to variables in vars to print in the table. Labels should be ordered according to the order of variables in vars . |
formatters::var_labels(df, fill = TRUE)[vars] |
lbl_overall |
(character ) If specified, an overall column will be added to the table with the given value as the column label. |
NULL |
prune_0 |
(flag ) Whether all-zero rows should be removed from the table. |
TRUE |
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.