Description Usage Arguments Value Author(s) Examples
Plot a binomial decision rule
1 2 3 | plotBinomRule(n, a1, b1, a2, b2, a = a1, b = b1, pi0 = 0.5, pi1 = 1
- pi0, c1 = 1, c2 = 1, c = c1/c2, rule = pi1/pi0 * c2/c1,
sizeby = c("none", "null", "alt"), geom = c("auto", "point", "tile"))
|
n |
number of trials (the same for both samples) |
a1 |
alpha, the hyperparameter of the beta distribution of the first poisson rate |
b1 |
beta, the hyperparameter of the beta distribution of the first poisson rate |
a2 |
alpha, the hyperparameter of the beta distribution of the second poisson rate |
b2 |
beta, the hyperparameter of the beta distribution of the second poisson rate |
a |
alpha, the hyperparameter of the beta distribution under the null |
b |
beta, the hyperparameter of the beta distribution under the null |
pi0 |
the prior probability of the null hypothesis |
pi1 |
the prior probability of the alternative hypothesis |
c1 |
loss associated with type I error |
c2 |
loss associated with type I error |
c |
relative loss constant (loss due to type II error divided by loss due to type I error) |
rule |
the decision rule for the Bayes factor B. by default, test rejects when B < pi1/pi0 * c2/c1 |
sizeby |
size the outcomes by the probability under the null or alternative |
geom |
ggplot2 geom used |
a ggplot object
David Kahle david.kahle@gmail.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
plotBinomRule(30, 1, 1, 1, 1)
plotBinomRule(100, 1, 1, 1, 1)
plotBinomRule(30, 1, 1, 1, 1, sizeby = "null")
plotBinomRule(30, 1, 1, 1, 1, sizeby = "alt") # uniform
plotBinomRule(30, 3, 7, 7, 3)
plotBinomRule(100, 3, 7, 7, 3)
plotBinomRule(30, 3, 7, 7, 3, sizeby = "null") + theme_bw()
plotBinomRule(30, 3, 7, 7, 3, sizeby = "alt") + theme_bw()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.