component_plot.hce {maraca} | R Documentation |
Generic function to create a plot showing the components used in calculating win odds (wins and ties) separately for each outcome directly from an hce object. Check the vignette "Maraca Plots - Plotting win odds" for more details.
Description
Generic function to create a plot showing the components used in calculating win odds (wins and ties) separately for each outcome directly from an hce object. Check the vignette "Maraca Plots - Plotting win odds" for more details.
Usage
## S3 method for class 'hce'
component_plot(
x,
step_outcomes = NULL,
last_outcome = "C",
arm_levels = c(active = "A", control = "P"),
fixed_followup_days = NULL,
theme = "maraca",
lowerBetter = FALSE,
...
)
Arguments
x |
an object of S3 class 'hce'. |
step_outcomes |
A vector of strings containing the outcome labels for all outcomes displayed as part of the step function on the left side of the plot. The order is kept for the plot. By default (when set to NULL) this is automatically updated by taking the non-continuous outcomes from the GROUP variable in alphabetical order. |
last_outcome |
A single string containing the last outcome label displayed on the right side of the plot. Default value "C". |
arm_levels |
A named vector of exactly two strings, mapping the values used for the active and control arms to the values used in the data. The names must be "active" and "control" in this order. Note that this parameter only need to be specified if you have labels different from "active" and "control". |
fixed_followup_days |
Not needed if HCE object contains information on fixed follow-up days in the study (column PADY or TTEfixed, depending on hce version). Otherwise, this argument must be specified. Note: If argument is specified and HCE object contains PADY or TTEfixed column, then fixed_followup_days argument is used. |
theme |
Choose theme to style the plot. The default theme is "maraca". Options are "maraca", "color1", "color2" and none". For more details, check the vignette called "Maraca Plots - Plotting win odds". |
lowerBetter |
Flag for the final outcome variable, indicating if lower values are considered better/advantageous. This flag is need to make sure the win odds are calculated correctly. Default value is FALSE, meaning higher values are considered advantageous. |
... |
not used |
Value
Component plot as a ggplot2 object.
Examples
Rates_A <- c(1.72, 1.74, 0.58, 1.5, 1)
Rates_P <- c(2.47, 2.24, 2.9, 4, 6)
hce_dat <- hce::simHCE(n = 2500, TTE_A = Rates_A, TTE_P = Rates_P,
CM_A = -3, CM_P = -6, CSD_A = 16, CSD_P = 15, fixedfy = 3,
seed = 31337)
component_plot(hce_dat)