Epidemiology & Technology

Sample Size for Correlations

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/vignettes/examples.html#:~:text=10.1%20One-,Correlation

https://cran.r-project.org/web/packages/pwrss/pwrss.pdf

Useful R Packages

REFERENCES

Related Posts