Skip to content

Is a directional p_rope possible? #637

Answered by mattansb
qdread asked this question in Q&A
Discussion options

You must be logged in to vote

bayesfactor_rope() has a direction to allow for comparing different hypotheses in the posterior(/prior)space.
p_rope() does not compare different hypotheses, it "simply" computes the posterior probability of the parameter being in the ROPE.

If you have a priori assumption the effect must be positive, this can be tested to be true with p_direction(), and the ROPE can be defined with a lower bound of -Inf.

library(rstanarm)
library(bayestestR)

mod <- stan_glm(mpg ~ qsec, data = mtcars)

p_direction(mod)
#> Probability of Direction 
#> 
#> Parameter   |     pd
#> --------------------
#> (Intercept) | 67.88%
#> qsec        | 99.20%

p_rope(mod, range = c(-Inf, 0.5))
#> Proportion of samples …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by mattansb
Comment options

You must be logged in to vote
1 reply
@mattansb
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #635 on December 01, 2023 04:04.