Treatment effect, comparator versus reference, overall and within each
level of subgroup_var. With time-to-event data (CNSR present) the
effect is a Cox hazard ratio on a log scale, and the survival package is
required. Otherwise it is a difference in means (Welch t-test) at the last
visit. Subgroups that cannot be estimated are dropped and listed in the
tlf_dropped attribute.
Usage
fig_forest(
df,
ctx = fig_ctx(),
subgroup_var = NULL,
ref_arm = NULL,
comp_arm = NULL,
ci = 0.95,
point_labels = TRUE,
base_size = NULL,
config = NULL
)Arguments
- df
Analysis data (BDS).
- ctx
A
fig_ctx()list.- subgroup_var
Subgroup column.
NULLuses the first ofSEX,AGEGR1,RACE,REGIONpresent.- ref_arm, comp_arm
Reference and comparator arms (default: first and last arm in sort order).
- ci
Confidence level.
- point_labels
Print the estimate and CI next to each row?
- base_size
Font size;
NULLuses the configuration.- config
A
tlf_config();NULLresolves throughtlf_get_config().
See also
Other figure builders:
fig_boxplot(),
fig_edish(),
fig_km(),
fig_lsmeans(),
fig_meanci(),
fig_shift(),
fig_spaghetti(),
fig_waterfall()
Examples
p <- fig_forest(ex_adlb[ex_adlb$PARAMCD == "ALT", ], subgroup_var = "SEX")
class(p)
#> [1] "ggplot2::ggplot" "ggplot" "ggplot2::gg" "S7_object"
#> [5] "gg"