To assess sample size for an expected Pearsons correlation ρ0 between two continuous variables
n = ([z1 – α + z1 − β]2/z02) + 3
Where z0 = 0.5 (ln [1 + ρ0] − ln [1 − ρ0])
This tests the hypothesis, H0: ρ = 0 versus H1: ρ = ρ0 > 0
Estimation in R
library(pwrss)
pwrss.z.corr(r = 0.50,
r0 = 0,
power = 0.95,
alpha = 0.05,
alternative = "not equal")
Code language: R (r)
Output
A Correlation against a Constant (z Test)
H0: r = r0
HA: r != r0
------------------------------
Statistical power = 0.95
n = 47
------------------------------
Alternative = “not equal”
Non-centrality parameter = 3.605
Type I error rate = 0.05
Type II error rate = 0.05
https://cran.r-project.org/web/packages/pwrss/pwrss.pdf
Useful R Packages
- pwrss
- pwr
- presize – requires shiny, ggplot2, shinydashboard – load and use launch_presize_app()
- Also see: https://bmcmedresmethodol.biomedcentral.com/articles/10.1186/s12874-022-01694-7 Sample size calculation for prevalence studies using Scalex and ScalaR calculators
- epiR
REFERENCES
- https://journals.lww.com/crst/fulltext/2020/03040/basics_of_statistics___4__sample_size_calculation.29.aspx
- Hulley SB, Cummings SR, Browner WS, Grady D, Newman TB. Designing clinical research : an epidemiologic approach. 4th ed. Philadelphia, PA: Lippincott Williams & Wilkins; 2013. Appendix 6C, page 79.
- https://www2.ccrb.cuhk.edu.hk/stat/other/correlation.htm#:~:text=Suppose%20one%20wishes%20to%20detect,47%20(n%3D47).
- Cleveland Calculators – https://riskcalc.org/samplesize/
- https://cran.r-project.org/web/packages/pwrss/vignettes/examples.html
- https://bmcmedresmethodol.biomedcentral.com/articles/10.1186/s12874-022-01694-7