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 I compare 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 I compare 2 samples

nmin

: Minimum number of individuals accepted for the sample.

nmax

: Maximum number of individuals attainable for the sample.

Value

: This function will tell you what the size of your two (supposedly normal) samples should be in order to be able to detect their difference in mean by a Student test with the desired significance (conf.level) and in a minimum number of cases (conf).

Examples

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

Antoine-Masse/KefiR documentation built on Feb. 22, 2024, 5:54 a.m.