View source: R/sample_bootstrap.R
cor_ech | R Documentation |
Anticipate the sample size needed to detect a correlation (if there is one)
cor_ech(x, y, iter = 100)
x |
The values of my x variable |
y |
The values of my y variable |
iter |
Number of iterations of bootstrapping |
The minimum sample size needed to detect a significant correlation with the given data, if a significant correlation exists. The function returns this sample size.
x <- c(1,5,6,9,10)
y <- c(0,4.5,10,9,30)
plot(x,y,cex=2,pch=16)
cor.test(x,y)$p.value # No significant
cor_ech(x,y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.