plot_interpretation_result_list {confinterpret} | R Documentation |
Plotting function for collection of interpretation_result objects
Description
Produces a plot presenting a collection of
interpretation_result
objects on a single chart. If the interpretation_result
objects are
named then the names will be used for labelling the relevant intervals on
the chart.
Usage
plot_interpretation_result_list(x, extra_boundaries = NULL,
estimates = NULL, boundary_values = TRUE, boundary_label_pos = "below",
interpretation_label_pos = "right", x_axis_pos = "below",
y_axis_pos = "none", inner_margin = c(-0.1, 0.05, -0.1, 0.05),
edge_margin = c(0, 0.02, 0, 0.02), edge_type = "gradient",
interval_type = "norm", y_scale = 0.75, interval_value_labels = TRUE,
estimate_value_labels = TRUE, plot_estimate_marks = TRUE, ...)
Arguments
x |
A list of |
extra_boundaries |
Names optional. |
estimates |
Estimate values that the intervals assessed in each
|
boundary_values |
A logical value indicating whether the values should be appended to the boundaries' names. |
boundary_label_pos |
Where to put the boundary labels.
Options are |
interpretation_label_pos |
Options are |
x_axis_pos |
Location of a numerical x axis.
Options are |
y_axis_pos |
Location of a numerical y axis. Default "none" will almost always be right.
Options are c |
inner_margin |
Numerical vector of the form |
edge_margin |
Numerical vector of the form |
edge_type |
What style of edge to draw at the sides of the plot. Currently supported
options are |
interval_type |
Set the way the interval is presented. Current options are
|
y_scale |
How tall the interval plots are to be drawn |
interval_value_labels |
Logical value specifying whether interval value labels are to be added. |
estimate_value_labels |
Logical value specifying whether estimate value labels are to be added. |
plot_estimate_marks |
Whether to plot marks at the x location of the estimates. |
... |
Further arguments passed to and from methods. |
Details
For a single interpretation_result
object a plot()
method is
provided; see plot.interpretation_result
.
To be a valid group of interpretation_result
objects, each of the
items in x
must be a valid interpretation_result
, and they
must all share some characteristics. Each of the component objects must have
been generated using the same interpretation_set
, with the same
boundaries, and the low_to_high
parameter must be the same. This
enables them to be meaningfully plotted on the same canvas.
Examples
# Set up some intervals to test:
ci_stage_1 <- matrix(c(0.023, 0.131), nrow = 1,
dimnames = list("estimate", c("2.5 %", "97.5 %")))
ci_stage_2 <- matrix(c(-0.016, 0.096), nrow = 1,
dimnames = list("estimate", c("2.5 %", "97.5 %")))
# Conduct the interpretations:
interp_stage_1 <- interpret_noninferiority(ci_stage_1, actual_null = 0,
ni_margin = 0.05,
groups = c("Business as usual",
"New approach"))
interp_stage_2 <- interpret_noninferiority(ci_stage_2, actual_null = 0,
ni_margin = 0.05,
groups = c("Business as usual",
"New approach"))
# Assemble the list object:
interp_1_and_2 <- list("Stage 1" = interp_stage_1,
"Stage 2" = interp_stage_2)
# Set a nice colour scheme
grDevices::palette(c("#FF671F99", "#F2A90099", "#0085CA99"))
plot_interpretation_result_list(interp_1_and_2,
boundary_label_pos = "on top")