Learn R Programming

ppRep (version 0.42.3)

postPPalpha: 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, ...)

Value

postPPalpha returns the marginal posterior density of the power parameter.

postPPalphaHPD returns the highest marginal posterior density interval of the power parameter.

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 \(\alpha\). Defaults to 1.

y

Number of failures parameter of beta prior \(\alpha\). Defaults to 1.

m

Mean parameter of initial normal prior for \(\theta\). Defaults to 0.

v

Variance parameter of initial normal prior for \(\theta\). Defaults to Inf (uniform prior).

...

Additional arguments passed to stats::integrate.

level

Credibility level of the highest posterior density interval. Defaults to 0.95.

Author

Samuel Pawel

See Also

postPP, postPPtheta, plotPP

Examples

Run this code
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)

Run the code above in your browser using DataLab