One-sided bf_pointnull vs bf_rope with range 0 to Inf #471
-
Hi, first thanks for this wonderful package. I'm not sure if this question is directly about bayestestR vs. being a slightly more broad conceptual question, but with regard to |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
This is a great questions, and I think it has to do with one of the differences between BFs and p-values in hypothesis testing; While for p-values we have a null hypothesis (e.g, b=0) and the alternative is implied from it (b≠0), for BFs the specification of the two hypotheses is completely independent of one another. E.g., we can have any of the following sets of hypotheses we might want to compare:
In practice, So what do the two specifications you made do? The default for
Setting
We can see this in the footer notes in the output - the null is only 0. library(bayestestR)
prior <- rt(4e3, df = 3)
posterior <- rnorm(4e3, mean = -.1, sd = .4)
(bf1 <- bayesfactor_pointnull(posterior, prior, direction = 'left'))
#> Bayes Factor (Savage-Dickey density ratio)
#>
#> BF
#> -----
#> 0.459
#>
#> * Evidence Against The Null: 0
#> * Direction: Left-Sided test When setting
But also, because how we've implemented to BFs, the alternative cannot overlap, so anything that is not the null is now:
Again, we can see this in the footer of the output: (bf2 <- bayesfactor_rope(posterior, prior, null = c(0, Inf)))
#> Bayes Factor (Null-Interval)
#>
#> BF
#> ----
#> 1.53
#>
#> * Evidence Against The Null: [0.000, Inf] Plotting the two can also help: (The marked / shaded areas are the null - everything else is the alterative): plot(bf1) plot(bf2) So we can see that the alternative in both cases is b<0, but the nulls are different! Hope this helps! |
Beta Was this translation helpful? Give feedback.
This is a great questions, and I think it has to do with one of the differences between BFs and p-values in hypothesis testing; While for p-values we have a null hypothesis (e.g, b=0) and the alternative is implied from it (b≠0), for BFs the specification of the two hypotheses is completely independent of one another.
E.g., we can have any of the following sets of hypotheses we might want to compare:
In practice,
bayestestR
dose constrain the hypotheses to (1) not overlap and (2) no have gaps between them (as we will see).So what do the two specifications you made do?
The …