Statistics · medium

Explain statistical power and what increases it.

Asked in Data Scientist interviews, in the Statistics round.

Short answer

Power is the probability of detecting an effect that is really there, one minus the Type II error rate. It rises with sample size, effect size and a higher alpha, and falls with variance. 80% is the usual target.

How to answer it

Power is the probability that the test rejects the null when the alternative is true. If the real lift is 2% and your test has 80% power at that effect, one run in five will miss it.

Four levers, and you should list them in one breath:

The practical use is before the test, not after. Fix alpha at 0.05 and power at 0.8, pick the minimum detectable effect the business would act on, and the formula gives the sample size and therefore the runtime. Computing "observed power" after a null result is circular, and interviewers know it.

from statsmodels.stats.power import NormalIndPower
n = NormalIndPower().solve_power(effect_size=0.05, alpha=0.05, power=0.8)

Related questions

Practice this for real