Description Usage Arguments Examples
Make a significance level curve
1 2 |
ts |
vector specifying x-range |
a1 |
alpha, the hyperparameter of the gamma distribution of the first poisson rate |
b1 |
beta, the hyperparameter of the gamma distribution of the first poisson rate |
a2 |
alpha, the hyperparameter of the gamma distribution of the second poisson rate |
b2 |
beta, the hyperparameter of the gamma distribution of the second poisson rate |
a |
alpha, the hyperparameter of the gamma distribution under the null |
b |
beta, the hyperparameter of the gamma distribution under the null |
pi0 |
the prior probability of the null hypothesis |
pi1 |
the prior probability of the alternative hypothesis |
c |
relative loss constant (loss due to type II error divided by loss due to type I error) |
family |
"binomial" or "poisson", depending on test |
ylim |
y limits |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | ## Not run:
a1 <- 2; b1 <- 6
a2 <- 3; b2 <- 3
plotAlpha(ts = c(0,250), a1, b1, a2, b2)
plotAlpha(ts = c(0,1000), a1, b1, a2, b2)
plotAlpha(ts = c(0,100), a1, b1, a2, b2)
plotAlpha(ts = 0:300, a1, b1, a2, b2, method = 'exact')
# this last plot shows that the approximation is not quite exact for small values
# but decent for larger ones
# styling, all ggplot2 styling works
plotAlpha(t = c(0,1000), a1, b1, a2, b2) +
theme_bw() + opts(title = 'My Power Plot')
a1 <- 4; b1 <- 4
a2 <- 8; b2 <- 4
plotAlpha(t = c(0,30), a1, b1, a2, b2, family = "poisson") +
geom_hline(yintercept = .80)
sampleAlpha(30, a1, b1, a2, b2, family = "binomial")
a1 <- 4; b1 <- 2
a2 <- 6; b2 <- 2
plotAlpha(t = c(0,1000), a1, b1, a2, b2)
plotAlpha(t = c(0,25), a1, b1, a2, b2)
plotAlpha(t = 0:25, a1, b1, a2, b2, method = 'exact')
a1 <- c(2,4); b1 <- c(6,2);
a2 <- c(3,6); b2 <- c(3,2);
plotAlpha(t = c(0,1000), a1, b1, a2, b2)
library(ggplot2)
last_plot() + theme_bw()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.