identify_ech: Identify the sample size needed to detect a difference...

View source: R/sample_bootstrap.R

identify_echR Documentation

Identify the sample size needed to detect a difference between two samples

Description

Identify the sample size needed to detect a difference between two samples

Usage

identify_ech(
  mean1,
  mean2,
  sd1,
  sd2,
  iter = 500,
  conf.level = 0.99,
  conf = 0.95,
  nmin = 2,
  nmax = 1000
)

Arguments

mean1

Sample Average 1

mean2

Sample Average 2

sd1

Sample standard deviation 1

sd2

Sample standard deviation 2

iter

Number of iterations per bootstrap

conf.level

Expected confidence on Student's test when comparing 2 samples (0 to 1)

conf

Percentage of times I expect to have a p-value that responds to my test if there is an effect when comparing 2 samples

nmin

Minimum number of individuals accepted for the sample.

nmax

Maximum number of individuals attainable for the sample.

Value

The required sample size to detect a difference in means by a Student test with the desired significance (conf.level) and in a minimum number of cases (conf). If the required sample size exceeds nmax, a warning message is printed.

Examples

identify_ech(mean1=100, mean2=101, sd1=2, sd2=3, nmax=10000)

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