safeguard.d.CI: Functions to explore different scenarios of replication

Description Usage Arguments Details Value Note Author(s) References Examples

View source: R/safeguard.d.CI.r

Description

These functions are meant to help the researcher in the exploration of different scenarios when planning a replication study. Starting from the original sample size and effect size and from a feasible sample size for the replication study, these functions allow to identify the corresponding safeguard confidence level at a given power and alpha level.

Usage

1
2
safeguard.d.CI (d, n.1, n.2, nrep, sig.level = .05, power = .8)
safeguard.r.CI (r, n, nrep, sig.level = .05, power = .8)

Arguments

d

Standardized mean difference, Cohen's d

r

Pearson's correlation coefficient

n

Sample size of the original study

n.1

Sample size for group 1 of the original study

n.2

Sample size for group 2 of the original study

nrep

Sample size of the replication study. The functions assume two equal samples for the replication, therefore an even number is expected.

sig.level

Significance level (Type I error probability or alpha)

power

Power of the test (1 minus Type II error probability or 1 minus beta)

Details

Function safeguard.d.CI and safeguard.r.CI compute the safeguard confidence interval that corresponds to a sample size for the replication study (nrep), at a certain level of power and of sig.level (Type I error), through a binary search. safeguard.d.CI takes the Cohen's d as input (assuming a two independent samples t-test), while safeguard.r.CI takes the Pearson correlation coefficient as input.

Value

CI, an integer representing the (one-tailed) confidence interval is returned. The output is therefore in the interval .5 <= CI <= 1.

Note

The functions identify the CI corresponding to a certain value of the replication sample size (nrep) through a binary search. A warning message is returned if the replication sample size nrep is too small (i.e., not large enough even to meet the requirements of a standard power analysis): in this case a value of CI = .5 is returned. If the value of CI is too close to .5 or to 1 (i.e., a difference less than 10e-6), the binary search is stopped and a value of .5 or 1 respectively is returned, with a warning message.

Author(s)

Giulio Costantini (giulio.costantini@unimib.it)

References

Perugini, M., Gallucci, M., Costantini, G. (in preparation) Safeguard Power as a Protection Against Imprecise Power Estimates

Examples

1
2
3
4
5
# example of function safeguard.d.CI
safeguard.d.CI(d = .8, n.1 = 30, n.2 = 30, nrep = 100)

# example of function safeguard.r.CI
safeguard.r.CI(r = .4, n = 30, nrep = 100)

GiulioCostantini/safeguardpower documentation built on May 6, 2019, 6:29 p.m.