plot.paired_equivalence: Plot the outcome of a paired equivalence test

View source: R/plot_paired_equivalence.R

plot.paired_equivalenceR Documentation

Plot the outcome of a paired equivalence test

Description

Plot the outcome of a paired equivalence test

Usage

## S3 method for class 'paired_equivalence'
plot(x, shade = "auto", ...)

shaded_equivalence_plot(results, ...)

unshaded_equivalence_plot(results, ...)

Arguments

x

the object to be plotted

shade

logical. Should the results be plotted using a shaded equivalence region?

...

arguments passed to ggplot2::theme.

results

data frame. The results component of a paired_equivalence object

Details

shaded_equivalence_plot plots the results of an equivalence test in which a single equivalence region applies to all variables. In that case, the equivalence region is displayed as a shaded region. unshaded_equivalence_plot plots the results of an equivalence test in which variables have unique equivalence regions. In that case, the equivalence regions are displayed as dodged "confidence intervals".

Value

A plot of the equivalence test

Examples

set.seed(1544)
y <- rnorm(500, 17.4, 9)
z <- data.frame(
  var1 = rnorm(500, 15, 4),
  var2 = rnorm(500, 23, 7.3)
)

# Optionally create artificial missing values to trigger unshaded plot
missing_indices <- sample(seq(nrow(z)), 250)
z$var1[missing_indices] <- NA

x <- paired_equivalence_test(
  z, y, "criterion", scale = "relative",
  relative_region_width = 0.25
)

plot(x)

PAutilities documentation built on Aug. 21, 2022, 9:05 a.m.