postPPalpha {ppRep} | R Documentation |
Marginal posterior distribution of power parameter
Description
These functions compute the marginal posterior of the power
parameter \alpha
. A power prior for \theta
is
constructed by updating an initial normal prior \theta \sim
\mathrm{N}(\code{m}, \code{v})
with the likelihood of
the original data raised to the power of \alpha
. A marginal
beta prior \alpha \sim \mbox{Beta}(\code{x},\code{y})
is assumed.
Usage
postPPalpha(alpha, tr, sr, to, so, x = 1, y = 1, m = 0, v = Inf, ...)
postPPalphaHPD(level = 0.95, tr, sr, to, so, x = 1, y = 1, m = 0, v = Inf, ...)
Arguments
alpha |
Power parameter. Can be a vector. |
tr |
Effect estimate of the replication study. |
sr |
Standard error of the replication effect estimate. |
to |
Effect estimate of the original study. |
so |
Standard error of the replication effect estimate. |
x |
Number of successes parameter of beta prior |
y |
Number of failures parameter of beta prior |
m |
Mean parameter of initial normal prior for |
v |
Variance parameter of initial normal prior for |
... |
Additional arguments passed to |
level |
Credibility level of the highest posterior density interval.
Defaults to |
Value
postPPalpha
returns the marginal posterior density of the power
parameter.
postPPalphaHPD
returns the highest marginal posterior density
interval of the power parameter.
Author(s)
Samuel Pawel
See Also
Examples
alpha <- seq(0, 1, 0.001)
margpostdens <- postPPalpha(alpha = alpha, tr = 0.1, to = 0.2, sr = 0.05, so = 0.05)
plot(alpha, margpostdens, type = "l", xlab = bquote("Power parameter" ~ alpha),
ylab = "Marginal posterior density", las = 1)