intro.Rmd
library(bfrr)
a <- rnorm(30, 0, 1)
b <- rnorm(30, 0.4, 1)
tt <- t.test(a, b)
sample_mean <- tt$estimate[[1]] - tt$estimate[[2]]
sample_se <- tt$stderr
sample_df <- tt$parameter[[1]]
rr <- bfrr(sample_mean, sample_se, sample_df,
model = "normal", mean = 0, sd = 0.5, tail = 1)
summary(rr)
The likelihood of your data under the theoretical distribution N(0, 0.5) is 0.10. The likelihood of your data under the null distribution T(56.7808) is 0.35. The Bayes Factor is 0.30; this test finds evidence for H0 with a criterion of 1/3. The region of theoretical model parameters that give the same conclusion is HN(0, [0.45, 1])
.
plot(rr)