Learn R Programming

BayesRepDesign (version 0.42)

designPrior: Design prior for effect size

Description

Creates a design prior for the effect size which can then be used for power and sample size calculations of a replication study. The design prior is obtained from updating an initial prior for the effect size by the data from the original study. A normal-normal hierarchical model is assumed, see Pawel et al. (2022) for details.

Usage

designPrior(
  to,
  so,
  mu = 0,
  sp = Inf,
  tau = 0,
  g = sp^2/(tau^2 + so^2),
  h = tau^2/so^2,
  type = c(NA, "conditional", "predictive", "EB")
)

Value

Returns an object of class "designPrior" which is a list containing:

dpMeanThe computed mean of the design prior
dpVarThe computed variance of the design prior
toThe specified original effect estimate
soThe specified original standard error
muThe specified mean of the initial prior
spThe specified standard deviation of the initial prior
tauThe specified heterogeneity variance

Arguments

to

Effect estimate from original study

so

Standard error of effect estimate from original study

mu

The initial prior mean. Defaults to 0

sp

The initial prior standard deviation. Defaults to Inf (an improper uniform prior)

tau

The initial prior heterogeneity standard deviation. Defaults to 0 (no heterogeneity)

g

The relative initial prior variance g = sp^2/(tau^2 + so^2) (alternative parametrization of prior standard deviation sp)

h

The relative initial prior heterogeneity variance h = tau^2/so^2 (alternative parametrization of prior heterogeneity standard deviation tau)

type

Shortcut for special parameter combinations. The available options are NA, "conditional", "predictive", and "EB" (see details). Defaults to NA

Author

Samuel Pawel

Details

The "conditional" design prior corresponds to a point mass at the original effect estimate, i.e., assuming that the true effect size is equal to the original effect estimate. The "predictive" design prior is obtained from updating a uniform initial prior by the likelihood of the original data. The "EB" design prior is obtained by empirical Bayes estimation of the variance of the normal prior and induces adaptive shrinkage that depends on the p-value of the original effect estimate.

References

Pawel, S., Consonni, G., and Held, L. (2022). Bayesian approaches to designing replication studies. arXiv preprint. tools:::Rd_expr_doi("10.48550/arXiv.2211.02552")

See Also

pors, ssd

Examples

Run this code
designPrior(to = 1.1, so = 1)

Run the code above in your browser using DataLab