cor_ech: Anticipate the sample size needed to detect a correlation (if...

View source: R/sample_bootstrap.R

cor_echR Documentation

Anticipate the sample size needed to detect a correlation (if there is one)

Description

Anticipate the sample size needed to detect a correlation (if there is one)

Usage

cor_ech(x, y, iter = 100)

Arguments

x

The values of my x variable

y

The values of my y variable

iter

Number of iterations of bootstrapping

Value

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.

Examples

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)

Antoine-Masse/KefiR documentation built on July 4, 2024, 11:40 a.m.