Type II Error Calculator Formula

Understand the math behind the type ii error calculator. Each variable explained with a worked example.

Formulas Used

Z for Power Calculation

z_power = z_beta

Standard Error

standard_error = se

Non-centrality Parameter

noncentrality = (mu1 - mu0) / se

Effect Size d

effect_size = (mu1 - mu0) / sigma

Variables

VariableDescriptionDefault
mu0Null Hypothesis Mean100
mu1True Mean105
sigmaPopulation SD15
nSample Size25
z_critCritical z (e.g., 1.96)1.96
seDerived value= sigma / sqrt(n)calculated
z_betaDerived value= z_crit - (mu1 - mu0) / secalculated

How It Works

Understanding Type II Error

Concept

Beta = P(fail to reject H0 | H0 is false)

Power = 1 - Beta

Type II error occurs when you fail to detect a real effect. The probability depends on the true effect size, sample size, significance level, and population variability. A negative z_beta value indicates high power (likely to detect the effect).

Worked Example

H0: mu = 100. True mu = 105. SD = 15, n = 25, z_crit = 1.96.

mu0 = 100mu1 = 105sigma = 15n = 25z_crit = 1.96
  1. 01SE = 15 / sqrt(25) = 15 / 5 = 3
  2. 02Non-centrality = (105 - 100) / 3 = 1.667
  3. 03z_beta = 1.96 - 1.667 = 0.293
  4. 04A z_beta of 0.293 corresponds to roughly beta = 0.615
  5. 05Power ≈ 1 - 0.615 = 0.385 (about 39%)
  6. 06This sample size gives low power to detect this effect

Ready to run the numbers?

Open Type II Error Calculator