confinterpret: Descriptive interpretations of confidence intervals.

Description Usage Arguments Details Value Examples

View source: R/confinterpret.R

Description

Produces descriptive interpretations of confidence intervals, depending on the type of test specified by an interpretation_set.

Usage

1
2
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 confint(), containing the confidence interval for the parameter estimate. The two columns provide the lower and upper confidence limits.

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 interpretation_set. Normally provided in low-to-high order, but see the low_to_high parameter for options.

comparison_labels

Character vector specifying the labels to be used within the interpretation to describe the comparison. Required if the interpretation_set includes a $placeholders entry. Null otherwise.

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

interpret_superiority

Non-inferiority tests

interpret_noninferiority

Equivalence tests

interpret_equivalence

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

1
2
3
4
5
6
7
# 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"))

confinterpret documentation built on May 1, 2019, 8:41 p.m.