repPosterior {BayesRep}R Documentation

Effect size posterior distribution

Description

Computes the posterior distribution of the effect size based on the original and replication effect estimates and their standard errors, assuming a common underlying effect size and an initial flat prior.

Usage

repPosterior(
  to,
  so,
  tr,
  sr,
  lower = min(c(to, tr)) - 4/sqrt(1/so^2 + 1/sr^2),
  upper = max(c(to, tr)) + 4/sqrt(1/so^2 + 1/sr^2),
  nGrid = 1000,
  plot = TRUE,
  CI = TRUE,
  ...
)

Arguments

to

Original effect estimate

so

Standard error of the original effect estimate

tr

Replication effect estimate

sr

Standard error of the replication effect estimate

lower

Lower bound of range for which distribution should computed. Defaults to minimum of to and tr minus four times the pooled standard error

upper

Upper bound of range for which distribution should computed. Defaults to maximum of to and tr plus four times the pooled standard error

nGrid

Number of grid points. Defaults to 1000

plot

Logical indicating whether posterior distribution should be plotted. If FALSE, only data used for plotting are returned. Defaults to TRUE

CI

Logical indicating whether 95% highest posterior credible interval should be plotted. Defaults to TRUE

...

Additional arguments passed to matplot

Value

Plots posterior distribution of the effect size, invisibly returns a list with the data for the plot

Author(s)

Samuel Pawel

Examples

## Example from Reproducibility Project Cancer Biology
## Aird: Data from https://elifesciences.org/articles/21253 Fig4B
hro <- 25.93
lhro <- log(hro)
hroCI <- c(5.48, 122.58)
se_lhro <- diff(log(hroCI))/(2*qnorm(0.975))
hrr <- 3.75
lhrr <- log(hrr)
hrrCI <- c(1.19, 11.81)
se_lhrr <- diff(log(hrrCI))/(2*qnorm(0.975))
repPosterior(to = lhro, so = se_lhro, tr = lhrr, sr = se_lhrr)

 

[Package BayesRep version 0.42.2 Index]