Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rope_range

Find Default Equivalence (ROPE) Region Bounds


Description

This function attempts at automatically finding suitable "default" values for the Region Of Practical Equivalence (ROPE).

Usage

rope_range(x, ...)

## Default S3 method:
rope_range(x, verbose = TRUE, ...)

Arguments

x

A stanreg, brmsfit or BFBayesFactor object.

...

Currently not used.

verbose

Toggle warnings.

Details

Kruschke (2018) suggests that the region of practical equivalence could be set, by default, to a range from -0.1 to 0.1 of a standardized parameter (negligible effect size according to Cohen, 1988).

  • For linear models (lm), this can be generalised to -0.1 * SDy, 0.1 * SDy.

  • For logistic models, the parameters expressed in log odds ratio can be converted to standardized difference through the formula π/√(3), resulting in a range of -0.18 to 0.18.

  • For other models with binary outcome, it is strongly recommended to manually specify the rope argument. Currently, the same default is applied that for logistic models.

  • For models from count data, the residual variance is used. This is a rather experimental threshold and is probably often similar to -0.1, 0.1, but should be used with care!

  • For t-tests, the standard deviation of the response is used, similarly to linear models (see above).

  • For correlations, -0.05, 0.05 is used, i.e., half the value of a negligible correlation as suggested by Cohen's (1988) rules of thumb.

  • For all other models, -0.1, 0.1 is used to determine the ROPE limits, but it is strongly advised to specify it manually.

References

Kruschke, J. K. (2018). Rejecting or accepting parameter values in Bayesian estimation. Advances in Methods and Practices in Psychological Science, 1(2), 270-280. doi: 10.1177/2515245918771304.

Examples

## Not run: 
if (require("rstanarm")) {
  model <- stan_glm(
    mpg ~ wt + gear,
    data = mtcars,
    chains = 2,
    iter = 200,
    refresh = 0
  )
  rope_range(model)

  model <- stan_glm(vs ~ mpg, data = mtcars, family = "binomial", refresh = 0)
  rope_range(model)
}

if (require("brms")) {
  model <- brm(mpg ~ wt + cyl, data = mtcars)
  rope_range(model)
}

if (require("BayesFactor")) {
  model <- ttestBF(mtcars[mtcars$vs == 1, "mpg"], mtcars[mtcars$vs == 0, "mpg"])
  rope_range(model)

  model <- lmBF(mpg ~ vs, data = mtcars)
  rope_range(model)
}

## End(Not run)

bayestestR

Understand and Describe Bayesian Models and Posterior Distributions

v0.10.0
GPL-3
Authors
Dominique Makowski [aut, cre] (<https://orcid.org/0000-0001-5375-9967>, @Dom_Makowski), Daniel Lüdecke [aut] (<https://orcid.org/0000-0002-8895-3206>, @strengejacke), Mattan S. Ben-Shachar [aut] (<https://orcid.org/0000-0002-4287-4801>, @mattansb), Indrajeet Patil [aut] (<https://orcid.org/0000-0003-1995-6531>, @patilindrajeets), Michael D. Wilson [aut] (<https://orcid.org/0000-0003-4143-7308>), Paul-Christian Bürkner [rev], Tristan Mahr [rev] (<https://orcid.org/0000-0002-8890-5116>), Henrik Singmann [ctb] (<https://orcid.org/0000-0002-4842-3657>), Quentin F. Gronau [ctb] (<https://orcid.org/0000-0001-5510-6943>), Sam Crawley [ctb] (<https://orcid.org/0000-0002-7847-0411>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.