proportionZTestMinimumEffect
Computes the minimum detectable effect size (MDE) for a proportion z-test at the given sample size.
Returns the smallest Cohen's h that a proportion z-test with n observations can detect at the specified power and alpha. This is useful for assessing whether an existing dataset or planned study is large enough to detect practically meaningful differences between proportions.
Example:
// Smallest effect detectable with 100 subjects per group (two-sample)
proportionZTestMinimumEffect(n = 100, power = 0.8) // ~0.398
proportionZTestMinimumEffect(n = 100, power = 0.8, twoSample = false) // ~0.281Return
the minimum detectable Cohen's h effect size. Always positive.
Parameters
the sample size. For two-sample tests (twoSample = true), this is the per-group size. For one-sample tests, this is the total sample size. 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.
whether this is a two-sample test. Defaults to true.
See also
to compute power at a given effect size.
to find the sample size needed for a target power.
to compute Cohen's h from two proportions.