Learn R Programming

BayesRepDesign (version 0.42)

se2n: Sample size related to standard error and unit standard deviation

Description

This function computes the sample size related to a specified standard error \(\sigma\) and unit standard deviation unitSD, which is the standard deviation of one effective unit (one measurement, one pair of measurements, one event, etc.). The relationship \(\sigma = \code{unitSD}/\sqrt{n}\) is assumed. The unit standard deviation depends on the parameter type and the assumptions underlying the standard error calculation. The default is unitSD = 2 which is, under some assumptions, a reasonable approximation to the unit standard deviation for standardized mean differences and log odds/hazard/rate ratios, see Section 2.4 in Spiegelhalter et al. (2004).

Usage

se2n(se, unitSD = 2)

Value

The sample size corresponding to the specified standard error and unit standard deviation

Arguments

se

Standard error

unitSD

Unit standard deviation. Defaults to 2

Author

Samuel Pawel

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")

Spiegelhalter, D.J., Abrams, K.R., Myles, J.P. (2004). Bayesian approaches to clinical trials and health care evaluation. Wiley. tools:::Rd_expr_doi("10.1002/0470092602")

Examples

Run this code
smd1 <- 0.3
so1 <- 0.05
dprior <- designPrior(to = smd1, so = so1)
ssd1 <- ssdSig(level = 0.025, dprior = dprior, power = 0.8)
se2n(se = ssd1$sr, unitSD = 2) # required n

Run the code above in your browser using DataLab