SSR.d: A priori safeguard power analysis

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

View source: R/SSR.d.r

Description

These functions are meant to be used when planning a study (not a replication study, but the original study). They return the sample size for the original study that guarantees a desired safeguard sample ratio (SSR) given the expected effect size for the study and given the parameters of the safeguard power analysis (alpha level, power, confidence level).

Usage

1
2
SSR.d (d, SSR = 1, conf = .80, sig.level = .05, power = .8, nmin = 4, nmax = 1e+6)
SSR.r (r, SSR = 1, conf = .80, sig.level = .05, power = .8, nmin = 4, nmax = 1e+6)

Arguments

d

Standardized mean difference (Cohen's d) that is expected for the study.

SSR

The desired safeguard sample ratio, i.e., the ratio between the sample size indicated by the safeguard power analysis and the sample size of the original study.

r

Pearson's correlation coefficient that is expected for the study

conf

Confidence interval (one-tailed) for computing the safeguard effect size, defaults to .80. It is required that .5 < conf < 1.

sig.level

Significance level (Type I error probability or alpha) that is used for the power analysis

power

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

nmin

Minimum sample size considered in the binary search

nmax

Maximum sample size considered in the binary search

Details

The functions SSR.d and SSR.r perform a binary search in the allowed values for the sample size (nmin, nmax), until a value for the sample size is identified that guarantees a safeguard sample ratio equal to SSR. Function SSR.d takes as input the Cohen's d effect size (assuming a two samples t-test), while function SSR.r takes as input the Pearson correlation coefficient.

Value

A vector of two integers.

N

The suggested (overall) sample size.

SSR

The value of the safeguard sample ratio that would be achieved using N as the sample size.

Note

In some situations adding or removing one participant (or one participant per group for the SSR.d, which assumes two samples) can alter the value of SSR greatly: some exact values of SSR cannot be reached with any nonfractional sample sizes, therefore the achieved SSR in output can be different (smaller) from that specified in input. In these situations the functions report the sample size that guarantees a SSR that is at least as good as that specified in input.

Author(s)

Giulio Costantini (giulio.costantini@unimib.it)

References

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# some examples in the main text in which the SSR is one.
SSR.d(d =  .5, SSR = 1)
SSR.d(d =  .8, SSR = 1)
SSR.d(d =   1, SSR = 1)
SSR.d(d = 1.5, SSR = 1)

# another example with SSR.d
SSR.d(d = 1.08, SSR = 1, conf = .95)

# an example of SSR.r
SSR.r(r = .4, SSR = 1, conf = .95)

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