
Display interactive baseline characteristic tables with AE subgroup analysis
Source:R/react_base_char.R
react_base_char.RdDisplay interactive baseline characteristic tables with AE subgroup analysis
Usage
react_base_char(
metadata_sl,
metadata_ae,
population = "apat",
observation = "wk12",
display_total = TRUE,
sl_parameter = "age;gender;race",
ae_subgroup = c("gender", "race"),
ae_specific = "rel",
ae_analysis = "ae_specific",
col_title = metalite::collect_title(metadata_ae, population, observation, ae_specific,
ae_analysis, "analysis"),
width = 1200
)Arguments
- metadata_sl
A metadata created by metalite, which builds the baseline characteristic table
- metadata_ae
A metadata created by metalite, which builds the AE subgroup specific table
- population
A character value of population term name. The term name is used as key to link information.
- observation
A character value of observation term name. The term name is used as key to link information.
- display_total
Display total column or not.
- sl_parameter
A character value of parameter term name for the baseline characteristic table. The term name is used as key to link information.
- ae_subgroup
A vector of strubf to specify the subgroups in the AE subgroup specific table.
- ae_specific
A string specifying the AE specific category.
- ae_analysis
A character value of analysis term name for the AE specific table.
- col_title
A character value of column title for the AE specific table.
- width
A numeric value of width of the table in pixels.
Examples
if (interactive()) {
sl_plan <- metalite::plan(
analysis = "base_char",
population = "apat",
observation = "apat",
parameter = "age;gender;race"
)
metadata_sl <- metalite::meta_adam(
observation = metalite_sl_adsl,
population = metalite_sl_adsl
) |>
metalite::define_plan(sl_plan) |>
metalite::define_population(
name = "apat",
group = "TRTA",
subset = SAFFL == "Y"
) |>
metalite::define_parameter(
name = "age",
var = "AGE",
label = "Age (years)",
vargroup = "AGEGR1"
) |>
metalite::define_parameter(name = "gender", var = "SEX", label = "Gender") |>
metalite::define_parameter(name = "race", var = "RACE", label = "Race") |>
metalite::define_analysis(
name = "base_char",
title = "Participant Baseline Characteristics by Treatment Group"
) |>
metalite::meta_build()
analysis_plan <- metalite::plan(
analysis = "ae_specific",
population = "apat",
observation = "wk12",
parameter = "rel"
)
metadata_ae <- metalite::meta_adam(
observation = metalite_sl_adae,
population = metalite_sl_adsl
) |>
metalite::define_plan(analysis_plan) |>
metalite::define_population(
name = "apat",
group = "TRTA",
subset = SAFFL == "Y",
label = "All Participants as Treated"
) |>
metalite::define_observation(
name = "wk12",
group = "TRTA",
subset = SAFFL == "Y",
label = "Weeks 0 to 12"
) |>
metalite::define_parameter(
name = "rel",
term1 = "Drug-Related",
term2 = "",
subset = AEREL %in% c("POSSIBLE", "PROBABLE"),
var = "AEDECOD",
soc = "AEBODSYS",
label = "Drug-related AEs"
) |>
metalite::define_analysis(
name = "ae_specific",
title = "Participants With Drug-Related Adverse Events"
) |>
metalite::meta_build()
react_base_char(
metadata_sl = metadata_sl,
metadata_ae = metadata_ae,
population = "apat",
observation = "wk12",
display_total = TRUE,
sl_parameter = "age;gender;race",
ae_subgroup = c("age", "race", "gender"),
ae_specific = "rel",
width = 1200
)
}