confinterpret {confinterpret} | R Documentation |
Descriptive interpretations of confidence intervals.
Description
Produces descriptive interpretations of confidence intervals, depending
on the type of test specified by an interpretation_set
.
Usage
confinterpret(ci, interpretation_set, boundaries, comparison_labels = NULL,
low_to_high = TRUE)
Arguments
ci |
A single row from a matrix of the type returned by |
interpretation_set |
List-based object that specifies the boundaries between regions that each of the confidence limits can fall in, and the interpretations to be returned in each of the cases. |
boundaries |
Vector of numbers specifying the values for each of the boundaries defined
in the |
comparison_labels |
Character vector specifying the labels to be used within the
interpretation to describe the comparison. Required if the
|
low_to_high |
Are the boundaries ordered low-to-high (TRUE) or high-to-low (FALSE)? This can be used to reverse the assessment, including in the cases where only one boundary is supplied. See Details. |
Details
Helpful wrapper functions are provided for some commonly used types of test:
- Superiority tests
- Non-inferiority tests
- Equivalence tests
The low_to_high parameter can be set to FALSE to facilitate the situation
where the boundaries are ordered high-to-low. This enables the same
interpretation_set
object to be used for both beneficial and harmful
outcomes. For an interpretation_set
that has been defined as if
higher numbers are better (for example, proportion of participants
recovering from a particular illness after treatment) then the inferiority
interpretations will be listed first and the superiority ones last. To use
this with a negative outcome (for example, proportion of participants
catching an illness after a preventative measure), provide the boundaries
in high-to-low order and use low_to_high = FALSE
. This will also
work where a single boundary is specified, and will act to 'reverse' the
interpretations.
The use of low_to_high only affects the order of the boundaries (and the regions these implicitly define). It does not affect the ordering of the confidence interval: the numerically lower confidence limit should be listed first either way.
Plotting functions are provided to display the results of
confinterpret
. To plot a single result see
plot.interpretation_result
. To plot multiple results on one
chart see plot_interpretation_result_list
.
Value
A list object of class interpretation_result
with
elements stating the interpretation in different formats, plus the
parameters used to generate the interpretation.
Examples
# Establish a test confidence interval
ci_test <- matrix(c(-0.1,0.1),
nrow = 1, dimnames = list("estimate",
c("2.5 %","97.5 %")))
confinterpret(ci_test, interpretations_superiority, 0,
comparison_labels = c(comparison_intervention = "Treatment as usual",
tested_intervention = "New treatment"))