plotPP {ppRep}R Documentation

Plot joint and marginal posterior distributions

Description

This convenience function computes and, if desired, visualizes the joint posterior density of effect size \theta and power parameter \alpha, as well as the marginal posterior densities of effect size \theta and power parameter \alpha individually. See the functions postPP, postPPalpha, and postPPtheta for more details on their computation.

Usage

plotPP(
  tr,
  sr,
  to,
  so,
  x = 1,
  y = 1,
  m = 0,
  v = Inf,
  thetaRange = c(tr - 3 * sr, tr + 3 * sr),
  alphaRange = c(0, 1),
  nGrid = 100,
  plot = TRUE,
  CI = FALSE,
  ...
)

Arguments

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

y

Number of failures parameter of beta prior for \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).

thetaRange

Range of effect sizes. Defaults to three standard errors around the replication effect estimate.

alphaRange

Range of power parameters. Defaults to the range between zero and one.

nGrid

Number of grid points. Defaults to 100.

plot

Logical indicating whether data should be plotted. If FALSE only the data used for plotting are returned.

CI

Logical indicating whether 95% highest posterior credible intervals should be plotted. Defaults to FALSE.

...

Additional arguments passed to stats::integrate for computation of posterior densities and highest posterior density credible intervals.

Value

Plots joint and marginal posterior densities, invisibly returns a list with the data for the plots.

Author(s)

Samuel Pawel

See Also

postPP, postPPalpha, postPPtheta

Examples

plotPP(tr = 0.2, sr = 0.05, to = 0.15, so = 0.05)

[Package ppRep version 0.42.3 Index]