p_rope {bayestestR} | R Documentation |
Probability of being in the ROPE
Description
Compute the proportion of the whole posterior distribution that doesn't lie within a region of practical equivalence (ROPE). It is equivalent to running rope(..., ci = 1)
.
Usage
p_rope(x, ...)
## S3 method for class 'numeric'
p_rope(x, range = "default", verbose = TRUE, ...)
## S3 method for class 'data.frame'
p_rope(x, range = "default", rvar_col = NULL, verbose = TRUE, ...)
## S3 method for class 'brmsfit'
p_rope(
x,
range = "default",
effects = "fixed",
component = "conditional",
parameters = NULL,
verbose = TRUE,
...
)
Arguments
x |
Vector representing a posterior distribution. Can also be a
|
... |
Currently not used. |
range |
ROPE's lower and higher bounds. Should be
In multivariate models, |
verbose |
Toggle off warnings. |
rvar_col |
A single character - the name of an |
effects |
Should variables for fixed effects ( For models of from packages brms or rstanarm there are additional options:
|
component |
Which type of parameters to return, such as parameters for the conditional model, the zero-inflated part of the model, the dispersion term, etc. See details in section Model Components. May be abbreviated. Note that the conditional component also refers to the count or mean component - names may differ, depending on the modeling package. There are three convenient shortcuts (not applicable to all model classes):
|
parameters |
Regular expression pattern that describes the parameters
that should be returned. Meta-parameters (like |
Model components
Possible values for the component
argument depend on the model class.
Following are valid options:
-
"all"
: returns all model components, applies to all models, but will only have an effect for models with more than just the conditional model component. -
"conditional"
: only returns the conditional component, i.e. "fixed effects" terms from the model. Will only have an effect for models with more than just the conditional model component. -
"smooth_terms"
: returns smooth terms, only applies to GAMs (or similar models that may contain smooth terms). -
"zero_inflated"
(or"zi"
): returns the zero-inflation component. -
"location"
: returns location parameters such asconditional
,zero_inflated
, orsmooth_terms
(everything that are fixed or random effects - depending on theeffects
argument - but no auxiliary parameters). -
"distributional"
(or"auxiliary"
): components likesigma
,dispersion
,beta
orprecision
(and other auxiliary parameters) are returned.
For models of class brmsfit
(package brms), even more options are
possible for the component
argument, which are not all documented in detail
here. See also ?insight::find_parameters
.
Examples
library(bayestestR)
p_rope(x = rnorm(1000, 0, 0.01), range = c(-0.1, 0.1))
p_rope(x = mtcars, range = c(-0.1, 0.1))