xtr_rope: Region of Practical Equivalence

View source: R/rope.R

xtr_ropeR Documentation

Region of Practical Equivalence

Description

Calculates the proportion of the posterior (or credible interval if level < 1) that falls within the region of practical equivalence (ROPE) to a threshold.

Usage

xtr_rope(
  x,
  threshold = 0,
  interval = c(-0.1, 0.1),
  ...,
  level = 1,
  type = "HDI",
  na_rm = FALSE
)

Arguments

x

A numeric vector of MCMC samples.

threshold

A number specifying the center of the ROPE.

interval

A numeric vector of length 2 to be added to threshold to calculate the ROPE. Generally, threshold[1] == - threshold[2] and threshold[1] < 0 should both be true.

...

Currently unused.

level

A number > 0 and <= 1 specifying the probability coverage of the interval to use. The default of 1 uses the full posterior.

type

A string indicating which type of CI to return. Currently allows Highest Density Intervals ("HDI"; default) and Equal-Tailed Intervals ("ETI").

na_rm

A flag indicating whether to remove missing values.

Details

The ROPE is calculated as threshold + interval. Note that the default is not appropriate for all models, since the interval is sensitive to unit conversions.

Value

A number indicating the proportion of the posterior (or credible interval) within the region of practical equivalence.

See Also

xtr_ci

Examples

xtr_rope(c(-Inf, -1, -0.1, 0.1, 1, Inf))
xtr_rope(rnorm(1e4))

extras documentation built on July 16, 2026, 1:07 a.m.