Let user specify an informative prior
Closed this issue · 1 comments
I was using BFA for a quick analysis of a Candy Japan A/B test, replacing prop.test
with a Bayesian test, and then demonstrating the difference that an informative prior on small effect sizes (in this case dbeta(900, 1407)
) makes. The model.code
functionality is very nice and convenient, but it still requires something like 18 lines to extract and copy-paste and isn't very friendly to the reader. It would be nice if I could do something like
fit1 <- bayes.prop.test(c(175, 168), c(442, 439))
# with informative prior:
fit2 <- bayes.prop.test(c(175, 168), c(442, 439), prior="dbeta(900,1407)")
And a prior
parameter gets substituted in the JAGS model code. (I peeked at the implementations but it looks like it bottoms out at something called jags_binom_test
which isn't available.)
By the way, there seems to be a typo in bayes.prop.test
where it prints "Bayesian First Aid poportion test" instead of "Bayesian First Aid proportion test".
I currently have no plans to include prior specification. But I encourage you to wrap your modified model code into a function for reuse! :)