Statistical Power for Experiment Design
Statistical Inference DS practice problem on Onlearn.
Difficulty: medium.
Topics: Understanding Statistical Power in A/B Testing, Cohen's d calculation, Normal CDF/PPF functions, Critical value determination, Power function derivation, Sampling distribution variance, Probability Theory, Inferential Statistics, Hypothesis Testing, Experimental Design, Linear Algebra, Type I Error Rate, Type II Error Rate, Standard Error, Effect Size Estimation, Z-distribution.
Implement a function 'calculate statistical power' that calculates the statistical power of a two sample Z test for a difference in means. The function should take the effect size (Cohen's d), alpha level (significance), and sample size per group as inputs. Assume a two tailed test and equal sample sizes.