postPPtheta {ppRep} | R Documentation |
Marginal posterior distribution of effect size
Description
These functions compute the marginal posterior of the effect
size \theta
. A power prior for \theta
is
constructed by updating an initial normal prior \theta \sim
\mathrm{N}(\code{m}, \code{v})
with likelihood of the
original data raised to the power of \alpha
. The power
parameter \alpha
can either be fixed to some value between 0
and 1 or it can have a beta prior distribution \alpha \sim
\mbox{Beta}(\code{x}, \code{y})
.
Usage
postPPtheta(
theta,
tr,
sr,
to,
so,
x = 1,
y = 1,
alpha = NA,
m = 0,
v = Inf,
hypergeo = FALSE,
...
)
postPPthetaHPD(
level,
tr,
sr,
to,
so,
x = 1,
y = 1,
alpha = NA,
m = 0,
v = Inf,
thetaRange = tr + c(-1, 1) * stats::qnorm(p = (1 + level)/2) * sr * 3,
quantileRange = c((1 - level) * 0.2, (1 - level) * 0.8),
...
)
Arguments
theta |
Effect size. 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 for beta prior of power parameter
|
y |
Number of failures parameter for beta prior of power parameter
|
alpha |
Power parameter. Can be set to a number between 0 and 1.
Defaults to |
m |
Mean parameter of initial normal prior for |
v |
Variance parameter of initial normal prior for |
hypergeo |
Logical indicating whether for uniform priors, the marginal
posterior should be computed with the hypergeometric function. Defaults
to |
... |
Additional arguments passed to |
level |
Credibility level of the highest posterior density interval.
Defaults to |
thetaRange |
The numerical search range for the effect size. Defaults to
the |
quantileRange |
The numerical search range for the lower posterior
quantile of the HPD interval. Defaults to the range between |
Value
postPPtheta
returns the marginal posterior density of the
effect size.
postPPthetaHPD
returns the highest marginal posterior density
interval of the effect size (this may take a while).
Author(s)
Samuel Pawel
See Also
Examples
theta <- seq(0, 0.6, 0.001)
margpostdens <- postPPtheta(theta = theta, tr = 0.1, to = 0.2, sr = 0.05, so = 0.05)
plot(theta, margpostdens, type = "l", xlab = bquote("Effect size" ~ theta),
ylab = "Marginal posterior density", las = 1)