Description Usage Arguments Value Author(s) References See Also Examples
View source: R/sampleSizeSignificance.R
The relative sample size to achieve significance of the replication study is computed based on the z-value of the original study, the significance level and either the power or the minimum relative effect size. When the approach based on power is used, the arguments design prior, shrinkage, and relative heterogeneity also have to be specified.
1 2 3 4 5 6 7 8 | sampleSizeSignificance(zo,
power,
d,
level = 0.025,
alternative = "one.sided",
designPrior = "conditional",
h = 0,
shrinkage = 0)
|
zo |
A vector of z-values from original studies. |
power |
The power to achieve replication success. |
d |
The minimum relative effect size (ratio of the effect estimate from the replication study to the effect estimate from the original study) |
level |
Significance level. Default is 0.025. |
alternative |
Either |
designPrior |
Is only taken into account when |
h |
Is only taken into account when |
shrinkage |
Is only taken into account when |
The relative sample size to achieve significance in the specified direction. If larger than 1000 then NA is returned.
Leonhard Held, Samuel Pawel, Charlotte Micheloud
Held, L. (2020). A new standard for the analysis and design of replication studies (with discussion). Journal of the Royal Statistical Society: Series A (Statistics in Society), 183, 431-448. https://doi.org/10.1111/rssa.12493
Pawel, S., Held, L. (2020). Probabilistic forecasting of replication studies. PLoS ONE 15(4):e0231416. https://doi.org/10.1371/journal.pone.0231416
Held, L., Micheloud, C. & Pawel, S. (2020). The assessment of replication success based on relative effect size. https://arxiv.org/abs/2009.07782
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | par(mfrow = c(1,2))
sampleSizeSignificance(zo = p2z(0.005), power = 0.8)
sampleSizeSignificance(zo = p2z(0.005, alternative = "greater"), power = 0.8)
sampleSizeSignificance(zo = p2z(0.005), power = 0.8, designPrior = "predictive")
sampleSizeSignificance(zo = 3, power = 0.8, designPrior = "predictive",
shrinkage = 0.5, h = 0.25)
sampleSizeSignificance(zo = 3, power = 0.8, designPrior = "EB",
h = 0.5)
# required relative sample size for 0.8 power as function of original p-value
zo <- p2z(seq(0.0001, 0.05, 0.0001))
plot(z2p(zo), sampleSizeSignificance(zo = zo, designPrior = "conditional", power = 0.8),
type = "l", ylim = c(0.5, 10), log = "y", lwd = 1.5, ylab = "Relative sample size",
xlab = expression(italic(p)[o]), las = 1)
lines(z2p(zo), sampleSizeSignificance(zo = zo, designPrior = "predictive", power = 0.8),
lwd = 2, lty = 2)
lines(z2p(zo), sampleSizeSignificance(zo = zo, designPrior = "EB", power = 0.8),
lwd = 1.5, lty = 3)
legend("topleft", legend = c("conditional", "predictive", "EB"),
title = "Design prior", lty = c(1, 2, 3), lwd = 1.5, bty = "n")
sampleSizeSignificance(zo = p2z(0.005), d = 1)
sampleSizeSignificance(zo = p2z(0.005), d = 0.5)
# required relative effect size of 0.8 power as function of original p-value
zo <- p2z(seq(0.0001, 0.05, 0.0001))
plot(z2p(zo), sampleSizeSignificance(zo = zo, d = 0.8, level = 0.025),
type = "l", ylim = c(0.5, 10), log = "y", lwd = 1.5, ylab = "Relative sample size",
xlab = expression(italic(p)[o]), las = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.