tTestMinimumEffect
Computes the minimum detectable effect size (MDE) for a t-test at the given sample size.
Returns the smallest Cohen's d that a t-test with n observations can detect at the specified power and alpha. This is useful for assessing whether an existing dataset is large enough to detect practically meaningful effects.
Example:
// Smallest effect detectable with 100 subjects per group
tTestMinimumEffect(n = 100, power = 0.8) // ~0.396
tTestMinimumEffect(n = 100, type = TTestType.ONE_SAMPLE) // ~0.281Return
the minimum detectable Cohen's d effect size. Always positive.
Parameters
the sample size. For TTestType.TWO_SAMPLE, this is the per-group size. For TTestType.ONE_SAMPLE and TTestType.PAIRED, this is the total size or number of pairs. Must be at least 2.
the target statistical power. Defaults to 0.8 (80%). Must be in (0, 1).
the significance level (Type I error rate). Defaults to 0.05 (5%). Must be in (0, 1).
the direction of the alternative hypothesis. Defaults to Alternative.TWO_SIDED.
the t-test design. Defaults to TTestType.TWO_SAMPLE.
See also
to compute power at a given effect size.
to find the sample size needed for a target power.