Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/cran/bayestestR
04 June 2025, 07:26:28 UTC
  • Code
  • Branches (32)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    • refs/tags/0.1.0
    • refs/tags/0.10.0
    • refs/tags/0.10.5
    • refs/tags/0.11.0
    • refs/tags/0.11.5
    • refs/tags/0.12.1
    • refs/tags/0.13.0
    • refs/tags/0.13.1
    • refs/tags/0.13.2
    • refs/tags/0.14.0
    • refs/tags/0.15.0
    • refs/tags/0.15.1
    • refs/tags/0.15.2
    • refs/tags/0.15.3
    • refs/tags/0.16.0
    • refs/tags/0.2.0
    • refs/tags/0.2.2
    • refs/tags/0.2.5
    • refs/tags/0.3.0
    • refs/tags/0.4.0
    • refs/tags/0.5.0
    • refs/tags/0.5.1
    • refs/tags/0.5.2
    • refs/tags/0.5.3
    • refs/tags/0.6.0
    • refs/tags/0.7.0
    • refs/tags/0.7.2
    • refs/tags/0.7.5
    • refs/tags/0.8.0
    • refs/tags/0.8.2
    • refs/tags/0.9.0
    No releases to show
  • 6366c5f
  • /
  • man
  • /
  • rope.Rd
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge Iframe embedding
swh:1:cnt:79ee2711f4a7d5aaf57d7e419d737d835a52321c
origin badgedirectory badge Iframe embedding
swh:1:dir:c6af825e5badebc12993a8ee9968fab1be48d8d0
origin badgerevision badge
swh:1:rev:40f7c88ddf855896018cf20ec8a7ac5fbd0ea2fb
origin badgesnapshot badge
swh:1:snp:5ae2939d3096a6dfbe0f03f295e3c5c9ab8f4cbc
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: 40f7c88ddf855896018cf20ec8a7ac5fbd0ea2fb authored by Dominique Makowski on 27 January 2020, 05:30:28 UTC
version 0.5.1
Tip revision: 40f7c88
rope.Rd
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rope.R
\name{rope}
\alias{rope}
\alias{rope.default}
\alias{rope.numeric}
\alias{rope.data.frame}
\alias{rope.emmGrid}
\alias{rope.BFBayesFactor}
\alias{rope.MCMCglmm}
\alias{rope.stanreg}
\alias{rope.brmsfit}
\title{Region of Practical Equivalence (ROPE)}
\usage{
rope(x, ...)

\method{rope}{default}(x, ...)

\method{rope}{numeric}(x, range = "default", ci = 0.89, ci_method = "HDI", verbose = TRUE, ...)

\method{rope}{data.frame}(x, range = "default", ci = 0.89, ci_method = "HDI", verbose = TRUE, ...)

\method{rope}{emmGrid}(x, range = "default", ci = 0.89, ci_method = "HDI", verbose = TRUE, ...)

\method{rope}{BFBayesFactor}(x, range = "default", ci = 0.89, ci_method = "HDI", verbose = TRUE, ...)

\method{rope}{MCMCglmm}(x, range = "default", ci = 0.89, ci_method = "HDI", verbose = TRUE, ...)

\method{rope}{stanreg}(
  x,
  range = "default",
  ci = 0.89,
  ci_method = "HDI",
  effects = c("fixed", "random", "all"),
  parameters = NULL,
  verbose = TRUE,
  ...
)

\method{rope}{brmsfit}(
  x,
  range = "default",
  ci = 0.89,
  ci_method = "HDI",
  effects = c("fixed", "random", "all"),
  component = c("conditional", "zi", "zero_inflated", "all"),
  parameters = NULL,
  verbose = TRUE,
  ...
)
}
\arguments{
\item{x}{Vector representing a posterior distribution. Can also be a \code{stanreg} or \code{brmsfit} model.}

\item{...}{Currently not used.}

\item{range}{ROPE's lower and higher bounds. Should be a vector of length two (e.g., \code{c(-0.1, 0.1)}) or \code{"default"}. If \code{"default"}, the range is set to \code{c(-0.1, 0.1)} if input is a vector, and based on \code{\link[=rope_range]{rope_range()}} if a Bayesian model is provided.}

\item{ci}{The Credible Interval (CI) probability, corresponding to the proportion of HDI, to use for the percentage in ROPE.}

\item{ci_method}{The type of interval to use to quantify the percentage in ROPE. Can be 'HDI' (default) or 'ETI'. See \code{\link{ci}}.}

\item{verbose}{Toggle off warnings.}

\item{effects}{Should results for fixed effects, random effects or both be returned?
Only applies to mixed models. May be abbreviated.}

\item{parameters}{Regular expression pattern that describes the parameters that
should be returned. Meta-parameters (like \code{lp__} or \code{prior_}) are
filtered by default, so only parameters that typically appear in the
\code{summary()} are returned. Use \code{parameters} to select specific parameters
for the output.}

\item{component}{Should results for all parameters, parameters for the conditional model
or the zero-inflated part of the model be returned? May be abbreviated. Only
applies to \pkg{brms}-models.}
}
\description{
Compute the proportion of the HDI (default to the 89\% HDI) of a posterior distribution that lies within a region of practical equivalence.
}
\details{
\subsection{ROPE}{
  Statistically, the probability of a posterior distribution of being
  different from 0 does not make much sense (the probability of a single value
  null hypothesis in a continuous distribution is 0). Therefore, the idea
  underlining ROPE is to let the user define an area around the null value
  enclosing values that are \emph{equivalent to the null} value for practical
  purposes (\cite{Kruschke 2010, 2011, 2014}).
  \cr \cr
  Kruschke (2018) suggests that such null value could be set, by default,
  to the -0.1 to 0.1 range of a standardized parameter (negligible effect
  size according to Cohen, 1988). This could be generalized: For instance,
  for linear models, the ROPE could be set as \code{0 +/- .1 * sd(y)}.
  This ROPE range can be automatically computed for models using the
  \link{rope_range} function.
  \cr \cr
  Kruschke (2010, 2011, 2014) suggests using the proportion of  the 95\%
  (or 89\%, considered more stable) \link[=hdi]{HDI} that falls within the
  ROPE as an index for "null-hypothesis" testing (as understood under the
  Bayesian framework, see \code{\link[=equivalence_test]{equivalence_test()}}).
}
\subsection{Sensitivity to parameter's scale}{
  It is important to consider the unit (i.e., the scale) of the predictors
  when using an index based on the ROPE, as the correct interpretation of the
  ROPE as representing a region of practical equivalence to zero is dependent
  on the scale of the predictors. Indeed, the percentage in ROPE depend on
  the unit of its parameter. In other words, as the ROPE represents a fixed
  portion of the response's scale, its proximity with a coefficient depends
  on the scale of the coefficient itself.
}
\subsection{Multicollinearity: Non-independent covariates}{
  When parameters show strong correlations, i.e. when covariates are not
  independent, the joint parameter distributions may shift towards or
  away from the ROPE. Collinearity invalidates ROPE and hypothesis
  testing based on univariate marginals, as the probabilities are conditional
  on independence. Most problematic are parameters that only have partial
  overlap with the ROPE region. In case of collinearity, the (joint) distributions
  of these parameters may either get an increased or decreased ROPE, which
  means that inferences based on \code{rope()} are inappropriate
  (\cite{Kruschke 2014, 340f}).
  \cr \cr
  \code{rope()} performs a simple check for pairwise correlations between
  parameters, but as there can be collinearity between more than two variables,
  a first step to check the assumptions of this hypothesis testing is to look
  at different pair plots. An even more sophisticated check is the projection
  predictive variable selection (\cite{Piironen and Vehtari 2017}).
}
\subsection{Strengths and Limitations}{
  \strong{Strengths:} Provides information related to the practical relevance of the effects.
  \cr \cr
  \strong{Limitations:} A ROPE range needs to be arbitrarily defined. Sensitive to the scale (the unit) of the predictors. Not sensitive to highly significant effects.
}
}
\examples{
library(bayestestR)

rope(x = rnorm(1000, 0, 0.01), range = c(-0.1, 0.1))
rope(x = rnorm(1000, 0, 1), range = c(-0.1, 0.1))
rope(x = rnorm(1000, 1, 0.01), range = c(-0.1, 0.1))
rope(x = rnorm(1000, 1, 1), ci = c(.90, .95))

\dontrun{
library(rstanarm)
model <- stan_glm(mpg ~ wt + gear, data = mtcars, chains = 2, iter = 200, refresh = 0)
rope(model)
rope(model, ci = c(.90, .95))

library(emmeans)
rope(emtrends(model, ~1, "wt"), ci = c(.90, .95))

library(brms)
model <- brms::brm(mpg ~ wt + cyl, data = mtcars)
rope(model)
rope(model, ci = c(.90, .95))

library(BayesFactor)
bf <- ttestBF(x = rnorm(100, 1, 1))
rope(bf)
rope(bf, ci = c(.90, .95))
}
}
\references{
\itemize{
\item Cohen, J. (1988). Statistical power analysis for the behavioural sciences.
\item Kruschke, J. K. (2010). What to believe: Bayesian methods for data analysis. Trends in cognitive sciences, 14(7), 293-300. \doi{10.1016/j.tics.2010.05.001}.
\item Kruschke, J. K. (2011). Bayesian assessment of null values via parameter estimation and model comparison. Perspectives on Psychological Science, 6(3), 299-312. \doi{10.1177/1745691611406925}.
\item Kruschke, J. K. (2014). Doing Bayesian data analysis: A tutorial with R, JAGS, and Stan. Academic Press. \doi{10.1177/2515245918771304}.
\item 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}.
\item Makowski D, Ben-Shachar MS, Chen SHA, Lüdecke D (2019) Indices of Effect Existence and Significance in the Bayesian Framework. Frontiers in Psychology 2019;10:2767. \doi{10.3389/fpsyg.2019.02767}
\item Piironen, J., & Vehtari, A. (2017). Comparison of Bayesian predictive methods for model selection. Statistics and Computing, 27(3), 711–735. \doi{10.1007/s11222-016-9649-y}
}
}

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API