[
  {
    "id": "cross-check-two-sample-d05",
    "title": "Two independent groups, medium effect (d = 0.5), 80% power, alpha 0.05",
    "sourceType": "cross-check",
    "source": {
      "citation": "Faul F, Erdfelder E, Lang AG, Buchner A. G*Power 3: a flexible statistical power analysis program for the social, behavioral, and biomedical sciences. Behav Res Methods. 2007;39(2):175-191.",
      "doi": "10.3758/bf03193146",
      "locator": "t tests, difference between two independent means, a priori: exact power from the noncentral t distribution; recomputed with scipy 1.17.1 (scipy.stats.nct)",
      "arithmetic": "Exact two-sided power is 0.801460 at 64 per group and 0.795168 at 63, so 64 is the smallest n reaching 0.80. The normal approximation gives 63."
    },
    "input": {
      "testType": "two-sample-t",
      "alpha": 0.05,
      "power": 0.8,
      "effectSize": 0.5,
      "solveFor": "sampleSize"
    },
    "expected": {
      "sampleSizePerGroup": 64
    }
  },
  {
    "id": "cross-check-paired-d05",
    "title": "Paired design, medium effect (d = 0.5), 80% power, alpha 0.05",
    "sourceType": "cross-check",
    "source": {
      "citation": "Faul F, Erdfelder E, Lang AG, Buchner A. G*Power 3: a flexible statistical power analysis program for the social, behavioral, and biomedical sciences. Behav Res Methods. 2007;39(2):175-191.",
      "doi": "10.3758/bf03193146",
      "locator": "t tests, difference between two dependent means (matched pairs), a priori; recomputed with scipy 1.17.1 (scipy.stats.nct)",
      "arithmetic": "Exact two-sided power is 0.807778 at 34 pairs and 0.795366 at 33, so 34 is the smallest n reaching 0.80. The normal approximation gives 32."
    },
    "input": {
      "testType": "paired-t",
      "alpha": 0.05,
      "power": 0.8,
      "effectSize": 0.5,
      "solveFor": "sampleSize"
    },
    "expected": {
      "sampleSizePerGroup": 34
    }
  },
  {
    "id": "cross-check-two-sample-d20",
    "title": "Two independent groups, very large effect (d = 2.0), 80% power, alpha 0.05",
    "sourceType": "cross-check",
    "source": {
      "citation": "Faul F, Erdfelder E, Lang AG, Buchner A. G*Power 3: a flexible statistical power analysis program for the social, behavioral, and biomedical sciences. Behav Res Methods. 2007;39(2):175-191.",
      "doi": "10.3758/bf03193146",
      "locator": "t tests, difference between two independent means, a priori; recomputed with scipy 1.17.1 (scipy.stats.nct)",
      "arithmetic": "Exact two-sided power is 0.876418 at 6 per group and 0.790542 at 5, so 6 is the smallest n reaching 0.80. The normal approximation gives 4, two animals per group too few."
    },
    "input": {
      "testType": "two-sample-t",
      "alpha": 0.05,
      "power": 0.8,
      "effectSize": 2,
      "solveFor": "sampleSize"
    },
    "expected": {
      "sampleSizePerGroup": 6
    }
  },
  {
    "id": "cross-check-power-two-sample-d20-n5",
    "title": "Achieved power with 5 per group at d = 2.0, alpha 0.05",
    "sourceType": "cross-check",
    "source": {
      "citation": "Faul F, Erdfelder E, Lang AG, Buchner A. G*Power 3: a flexible statistical power analysis program for the social, behavioral, and biomedical sciences. Behav Res Methods. 2007;39(2):175-191.",
      "doi": "10.3758/bf03193146",
      "locator": "t tests, difference between two independent means, post hoc power; recomputed with scipy 1.17.1 (scipy.stats.nct)",
      "arithmetic": "df = 2 × 5 − 2 = 8; noncentrality = 2.0 × √(5/2) = 3.162278; critical t(0.975, 8) = 2.306004; power = 1 − F(2.306004) + F(−2.306004) under the noncentral t(8, 3.162278) = 0.790542."
    },
    "input": {
      "testType": "two-sample-t",
      "alpha": 0.05,
      "power": 0.8,
      "effectSize": 2,
      "n": 5,
      "solveFor": "power"
    },
    "expected": {
      "power": 0.790542
    },
    "tolerance": {
      "power": 0.000001
    }
  },
  {
    "id": "hand-worked-proportions",
    "title": "Two proportions, 50% against 30%, 80% power, alpha 0.05",
    "sourceType": "hand-worked",
    "source": {
      "citation": "Fleiss JL, Levin B, Paik MC. Statistical Methods for Rates and Proportions. 3rd ed. Hoboken (NJ): Wiley; 2003. ISBN 0-471-52629-0.",
      "locator": "Sample size for comparing two independent proportions, without the continuity correction",
      "arithmetic": "p̄ = (0.5 + 0.3) / 2 = 0.4, q̄ = 0.6. z(0.975) × √(2 p̄ q̄) = 1.959964 × 0.692820 = 1.357903. z(0.80) × √(p₁q₁ + p₂q₂) = 0.841621 × √(0.25 + 0.21) = 0.841621 × 0.678233 = 0.570815. n = (1.357903 + 0.570815)² / (0.5 − 0.3)² = 1.928718² / 0.04 = 92.9988, rounded up to 93 per group."
    },
    "input": {
      "testType": "chi-square",
      "alpha": 0.05,
      "power": 0.8,
      "p1": 0.5,
      "p2": 0.3,
      "solveFor": "sampleSize"
    },
    "expected": {
      "sampleSizePerGroup": 93
    }
  },
  {
    "id": "edge-tiny-effect",
    "title": "Two independent groups, very small effect (d = 0.1), 80% power, alpha 0.05",
    "sourceType": "cross-check",
    "source": {
      "citation": "Faul F, Erdfelder E, Lang AG, Buchner A. G*Power 3: a flexible statistical power analysis program for the social, behavioral, and biomedical sciences. Behav Res Methods. 2007;39(2):175-191.",
      "doi": "10.3758/bf03193146",
      "locator": "t tests, difference between two independent means, a priori; recomputed with scipy 1.17.1 (scipy.stats.nct)",
      "arithmetic": "Exact two-sided power is 0.800067 at 1571 per group and 0.799817 at 1570, so 1571 is the smallest n reaching 0.80. The normal approximation gives 1570."
    },
    "input": {
      "testType": "two-sample-t",
      "alpha": 0.05,
      "power": 0.8,
      "effectSize": 0.1,
      "solveFor": "sampleSize"
    },
    "expected": {
      "sampleSizePerGroup": 1571
    }
  }
]
