Learn R Programming

PAutilities (version 1.1.0)

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

Description

Plot the outcome of a paired equivalence test

Usage

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

shaded_equivalence_plot(results, ...)

unshaded_equivalence_plot(results, ...)

Value

A plot of the equivalence test

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".

Examples

Run this code
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)

Run the code above in your browser using DataLab