plot.interpretation_result {confinterpret} | R Documentation |
Plot an interpretation_result, as returned by confinterpret()
Description
Produces a diagram that illustrates the confidence interval that was
interpreted using confinterpret
against a background
illustrating the interpretation_set
that it was the basis for
the interpretation.
Usage
## S3 method for class 'interpretation_result'
plot(x, extra_boundaries = NULL,
estimate = 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", interval_value_labels = TRUE,
estimate_value_labels = TRUE, plot_estimate_marks = TRUE,
estimate_mark_points = c(0, 0.05, 0, -0.05), ...)
Arguments
x |
An |
extra_boundaries |
A vector of numerical values specifying the position for displaying
additional boundaries, not specified in the |
estimate |
Estimate value that the interval relates to. If not specified, a default of the central point between the two ends of the interval will be assumed. |
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
|
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. |
estimate_mark_points |
y positions of the ends of the estimate marks as a numeric vector of length 4. Values are, in order: start (relative to centre), end (relative to box top), start (relative to centre), end (relative to box bottom). |
... |
Further arguments passed to and from methods. |
Details
Additional boundaries can be displayed using the extra_boundaries
parameter. This can be helpful if you want to show a position that is
of some practical relevance, but is not defined as a boundary for the
purposes of the interpretation_set
.
If you wish to plot multiple interpretation_result
objects on one
chart, see plot_interpretation_result_list
.
Plots use the current R Graphics Palette, so you may wish to set that to something attractive before plotting. See ?palette.
Examples
# Set a nice colour scheme
grDevices::palette(c("#FF671F99", "#F2A90099", "#0085CA99"))
# Set up a confidence interval to interpret
ci_test <- matrix(c(-0.03, 0.05),
nrow = 1,
dimnames = list("estimate", c("2.5 %", "97.5 %")))
noninf <- interpret_noninferiority(ci_test, 0, 0.05, c("Treatment as usual",
"New treatment"))
plot(noninf)