# A college dormitory recently sponsored a taste comparison between
# two major soft drinks. Of the 64 students who participated, 39 selected
# brand A, and only 25 selected brand B. Example from
# http://www.elderlab.yorku.ca/~aaron/Stats2022/BinomialTest.htm
bayes.binom.test(x = 39, n = 64)
# Save the return value in order to inspect the model result further.
fit <- bayes.binom.test(x = 39, n = 64, cred.mass=0.8)
summary(fit)
plot(fit)
# MCMC diagnostics (should not be necessary for such a simple model)
diagnostics(fit)
# Print out the R code to run the model. This can be copy n' pasted into
# an R-script and further modified.
model.code(fit)
Run the code above in your browser using DataLab