ssd {BayesRepDesign}R Documentation

Sample size determination for replication success

Description

This function computes the standard error of the replication effect estimate required to achieve replication success with a certain probability and based on a certain type of success region.

Usage

ssd(
  sregionfun,
  dprior,
  power,
  nsites = 1,
  searchInt = c(.Machine$double.eps^0.5, 4),
  ...
)

Arguments

sregionfun

Function that returns the success region for replication effect estimate as a function of the replication standard error

dprior

Design prior object

power

Desired probability of replication success

nsites

Number of sites. Defaults to 1. The sites are assumed to have the same sample size

searchInt

Search interval for standard errors

...

Other arguments passed to uniroot

Value

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

designPrior The specified "designPrior" object
power The specified power
powerRecomputed The recomputed power
sr The required replication standard error
c The required relative sample size c = nr/no (assuming so = unitSD/no and sr = unitSD/nr)

Author(s)

Samuel Pawel

References

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

Examples

## specify design prior
to1 <- 2
so1 <- 1
dprior <- designPrior(to = to1, so = so1)

## compute required standard error for significance at one-sided 2.5%
sregionfunSig <- function(sr, alpha = 0.025) {
    successRegion(intervals = cbind(stats::qnorm(p = 1- alpha)*sr, Inf))
}
ssd(sregionfun = sregionfunSig, dprior = dprior, power = 0.8)


[Package BayesRepDesign version 0.42 Index]