This question evaluates understanding of statistical power and sample size calculation for a two-sided A/B z-test as well as basic Bayesian posterior computation, with emphasis on estimating outcome variance and updating probabilities in the Statistics & Math domain.
You are given:
observed
: an array of numeric outcomes from historical data (use it to estimate the outcome standard deviation)
alpha
: significance level for a
two-sided
z-test (e.g., 0.05)
power
: desired power (e.g., 0.8)
delta
: the minimum detectable absolute difference in means between treatment and control
Assume:
sigma = std(observed)
as the standard deviation estimate.
Task: compute the minimum total sample size N_total = N_control + N_treatment required to detect a mean difference of delta with significance alpha and power power. Round up to the nearest integer.
Given probabilities:
p_A = P(A)
p_B_given_A = P(B|A)
p_B_given_notA = P(B|¬A)
Task: compute and return P(A|B).
Return:
N_total
(integer)
p_A_given_B
(float)
Login required