# Function calculateMinSampleSize

Learning exports - Closed-loop feedback and routing improvement Split from index.ts for file size compliance (Issue #285)

- calculateMinSampleSize(
  baselineRate: number,
  minimumDetectableEffect: number,
  options?: { power?: number; alpha?: number },
  ): number

  Calculate minimum sample size for detecting a difference in proportions. Uses formula for two-proportion z-test power analysis.

  #### Parameters

  - baselineRate: number
  - minimumDetectableEffect: number
  - options: { power?: number; alpha?: number } = {}

  #### Returns number

  - Defined in packages/nexus-agents/src/learning/validation-stats.ts:330