{
  "id": "statistical-power",
  "version": "dc4a067df1fd",
  "status": "published",
  "name": "Statistical Power Calculator",
  "question": "What is my test’s statistical power?",
  "summary": "Finds the statistical power of a one-sample, paired or two-sample t test or z test from the effect size (Cohen’s d), the sample size and α, with β, the noncentrality and the critical value.",
  "category": "statistics",
  "subcategory": "tests",
  "url": "https://www.acalculator.org/statistics/statistical-power-calculator",
  "markdown": "https://www.acalculator.org/statistics/statistical-power-calculator.md",
  "kind": "function",
  "method": "λ = d√n (one sample) or d√(n/2) (two groups of n). z test: power = Φ(λ − z(1 − α/2)) + Φ(−λ − z(1 − α/2)), or Φ(λ − z(1 − α)) one-sided. t test: power = P(T′ > t(1 − α/2; ν)) + P(T′ < −t(1 − α/2; ν)) for T′ noncentral t with ν = n − 1 or 2(n − 1) and noncentrality λ; one-sided P(T′ > t(1 − α; ν)).",
  "assumptions": [
    "The data are normal (or n is large), the observations independent, and two groups have the same size and standard deviation.",
    "d is the true effect in the tested direction, so it is 0 or more."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "test": {
        "title": "Test",
        "description": "The test you plan: a t test (σ estimated from the data) or a z test (σ known), for one mean or two.",
        "type": "string",
        "enum": [
          "t1",
          "t2",
          "z1",
          "z2"
        ]
      },
      "tails": {
        "title": "Alternative",
        "description": "Two-sided: the effect may go either way. One-sided: you test one direction only.",
        "type": "string",
        "enum": [
          "two",
          "one"
        ]
      },
      "d": {
        "title": "Effect size (Cohen’s d)",
        "description": "The difference you want to detect divided by the standard deviation: (μ − μ₀) ÷ σ, or (μ₁ − μ₂) ÷ σ for two groups.",
        "type": "number",
        "minimum": 0,
        "maximum": 10
      },
      "n": {
        "title": "Sample size (n per group)",
        "description": "The number of observations, or of pairs; for two samples, the number in each group.",
        "type": "integer",
        "minimum": 2,
        "maximum": 100000
      },
      "a": {
        "title": "Significance level (α)",
        "description": "The chance of a false positive the test allows, such as 0.05.",
        "type": "number",
        "minimum": 0.0001,
        "maximum": 0.5
      }
    }
  },
  "outputs": {
    "power": {
      "label": "Power (1 − β)",
      "description": "The chance that the test rejects H₀ when the effect is real, in percent.",
      "format": "percent"
    },
    "beta": {
      "label": "Type II error rate (β)",
      "description": "The chance of missing a real effect of this size: 100% − power.",
      "format": "text"
    },
    "lambda": {
      "label": "Noncentrality (λ)",
      "description": "d√n for one sample, or d√(n/2) for two groups of n.",
      "format": "number"
    },
    "crit": {
      "label": "Critical value",
      "description": "The z or t value the test statistic must pass: for α/2 two-sided, or α one-sided.",
      "format": "number"
    },
    "df": {
      "label": "Degrees of freedom (ν)",
      "description": "n − 1, or 2(n − 1) for two groups; t tests only.",
      "format": "integer"
    },
    "total": {
      "label": "Total sample size",
      "description": "n, or 2n for two groups.",
      "format": "integer"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "test": "t1",
      "tails": "two",
      "d": 0.5,
      "n": 30,
      "a": 0.05
    },
    "outputs": {
      "power": 75.39647157437905,
      "beta": "24.60%",
      "lambda": 2.7386127875258306,
      "crit": 2.0452296421327048,
      "df": 29,
      "total": 30
    },
    "text": "The power is 75.40%, so the chance of missing a real effect of d = 0.5 is 24.60%."
  },
  "examples": [
    {
      "given": {
        "test": "z1",
        "tails": "one",
        "d": 1,
        "n": 9,
        "a": 0.05
      },
      "expect": {
        "power": 91.23145367502966,
        "lambda": 3,
        "crit": 1.6448536269514722,
        "beta": "8.77%"
      },
      "source": "NIST/SEMATECH e-Handbook of Statistical Methods, §7.2.2.2 Sample sizes required (N = (z(1 − α/2) + z(1 − β))² (σ/δ)² for a two-sided test and (z(1 − α) + z(1 − β))² (σ/δ)² one-sided; α = 0.05, β = 0.10 and a shift of one standard deviation give N = (1.645 + 1.282)² = 8.567 ≈ 9; with s, (1.860 + 1.397)² = 10.6 ≈ 11), https://www.itl.nist.gov/div898/handbook/prc/section2/prc222.htm (retrieved 2026-10-19); hand calculation in content.mdx: Φ(3 − 1.64485) = Φ(1.35515) = 0.912315",
      "tolerance": 1e-12
    },
    {
      "given": {
        "test": "t1",
        "tails": "one",
        "d": 1,
        "n": 11,
        "a": 0.05
      },
      "expect": {
        "power": 92.44890652753152,
        "df": 10,
        "crit": 1.8124611228116767
      },
      "source": "NIST/SEMATECH e-Handbook of Statistical Methods, §7.2.2.2 Sample sizes required (N = (z(1 − α/2) + z(1 − β))² (σ/δ)² for a two-sided test and (z(1 − α) + z(1 − β))² (σ/δ)² one-sided; α = 0.05, β = 0.10 and a shift of one standard deviation give N = (1.645 + 1.282)² = 8.567 ≈ 9; with s, (1.860 + 1.397)² = 10.6 ≈ 11), https://www.itl.nist.gov/div898/handbook/prc/section2/prc222.htm (retrieved 2026-10-19); SAS/STAT, The Analyst Application, Sample Size and Power Calculations, Hypothesis Tests (Power = Prob(t > t_crit, ν, NC) one-sided, + Prob(t < t_critl, ν, NC) two-sided; ν = n − 1 and NC = δ√n for one-sample and paired t tests; ν = 2(n − 1) and NC = δ ÷ √(2/n) for two samples of n each; δ = (μ − μ₀) ÷ s), https://support.sas.com/documentation/cdl/en/anlystug/58352/HTML/default/chap12_sect7.htm (retrieved 2026-10-19); Python check by numerical integration of the noncentral t in docs/progress/WP-146/xcheck.py (agrees to about 10⁻¹²)",
      "tolerance": 1e-9
    },
    {
      "given": {
        "test": "t2",
        "tails": "two",
        "d": 0.5,
        "n": 64,
        "a": 0.05
      },
      "expect": {
        "power": 80.14595579222596,
        "df": 126,
        "total": 128,
        "lambda": 2.8284271247461903
      },
      "source": "SAS/STAT, The Analyst Application, Sample Size and Power Calculations, Hypothesis Tests (Power = Prob(t > t_crit, ν, NC) one-sided, + Prob(t < t_critl, ν, NC) two-sided; ν = n − 1 and NC = δ√n for one-sample and paired t tests; ν = 2(n − 1) and NC = δ ÷ √(2/n) for two samples of n each; δ = (μ − μ₀) ÷ s), https://support.sas.com/documentation/cdl/en/anlystug/58352/HTML/default/chap12_sect7.htm (retrieved 2026-10-19); Python check by numerical integration of the noncentral t in docs/progress/WP-146/xcheck.py (agrees to about 10⁻¹²)",
      "tolerance": 1e-9
    },
    {
      "given": {
        "test": "t1",
        "tails": "two",
        "d": 0,
        "n": 20,
        "a": 0.05
      },
      "expect": {
        "power": 5
      },
      "source": "SAS/STAT, The Analyst Application, Sample Size and Power Calculations, Hypothesis Tests (Power = Prob(t > t_crit, ν, NC) one-sided, + Prob(t < t_critl, ν, NC) two-sided; ν = n − 1 and NC = δ√n for one-sample and paired t tests; ν = 2(n − 1) and NC = δ ÷ √(2/n) for two samples of n each; δ = (μ − μ₀) ÷ s), https://support.sas.com/documentation/cdl/en/anlystug/58352/HTML/default/chap12_sect7.htm (retrieved 2026-10-19); hand calculation in content.mdx: λ = 0 makes T′ the central t, so P(|T| > t_c) = α",
      "tolerance": 1e-12
    },
    {
      "given": {
        "test": "z2",
        "tails": "two",
        "d": 0.5,
        "n": 64,
        "a": 0.05
      },
      "expect": {
        "power": 80.74304194325573,
        "lambda": 2.8284271247461903,
        "crit": 1.959963984540054
      },
      "source": "NIST/SEMATECH e-Handbook of Statistical Methods, §7.2.2.2 Sample sizes required (N = (z(1 − α/2) + z(1 − β))² (σ/δ)² for a two-sided test and (z(1 − α) + z(1 − β))² (σ/δ)² one-sided; α = 0.05, β = 0.10 and a shift of one standard deviation give N = (1.645 + 1.282)² = 8.567 ≈ 9; with s, (1.860 + 1.397)² = 10.6 ≈ 11), https://www.itl.nist.gov/div898/handbook/prc/section2/prc222.htm (retrieved 2026-10-19); hand calculation in content.mdx: Φ(2.82843 − 1.95996) + Φ(−2.82843 − 1.95996)",
      "tolerance": 1e-12
    },
    {
      "given": {
        "test": "t1",
        "tails": "two",
        "d": 0.5,
        "n": 20,
        "a": 0.05
      },
      "expect": {
        "power": 56.45044184390198
      },
      "source": "SAS/STAT, The Analyst Application, Sample Size and Power Calculations, Hypothesis Tests (Power = Prob(t > t_crit, ν, NC) one-sided, + Prob(t < t_critl, ν, NC) two-sided; ν = n − 1 and NC = δ√n for one-sample and paired t tests; ν = 2(n − 1) and NC = δ ÷ √(2/n) for two samples of n each; δ = (μ − μ₀) ÷ s), https://support.sas.com/documentation/cdl/en/anlystug/58352/HTML/default/chap12_sect7.htm (retrieved 2026-10-19); Python check by numerical integration of the noncentral t in docs/progress/WP-146/xcheck.py (agrees to about 10⁻¹²)",
      "tolerance": 1e-9
    }
  ],
  "sources": [
    "NIST/SEMATECH e-Handbook of Statistical Methods, §7.2.2.2 Sample sizes required: N = (z(1 − α/2) + z(1 − β))² (σ/δ)² (two-sided) and (z(1 − α) + z(1 − β))² (σ/δ)² (one-sided); with α = 0.05, β = 0.10 and a one standard deviation shift, N = (1.645 + 1.282)² = 8.567 ≈ 9, and with s from the data (1.860 + 1.397)² = 10.6 ≈ 11, retrieved 2026-10-19. https://www.itl.nist.gov/div898/handbook/prc/section2/prc222.htm",
    "SAS/STAT, The Analyst Application, Sample Size and Power Calculations, Hypothesis Tests: power = Prob(t > t_crit, ν, NC) one-sided, plus Prob(t < t_critl, ν, NC) two-sided; ν = n − 1 and NC = δ√n for one-sample and paired t tests; ν = 2(n − 1) and NC = δ ÷ √(2/n) for two samples of n each, retrieved 2026-10-19. https://support.sas.com/documentation/cdl/en/anlystug/58352/HTML/default/chap12_sect7.htm"
  ],
  "related": [
    "sample-size",
    "effect-size",
    "t-test",
    "hypothesis-test"
  ],
  "changelog": []
}
