KatInterview

CTR Confidence Intervals and Variance Decomposition

Statistics & ExperimentsModel answer
MediumModel answerStatistics & Experimentsconfidence-intervalsbinomial-proportionvariance

Last updated

Derive a pooled click-through rate estimator, compare Wald vs. exact binomial confidence intervals, and separate real day-to-day volatility from sampling noise.

Background

You are a data scientist reviewing the daily performance of a newly launched social feature. For each of the past 7 days you have three numbers:

  • $n_i$: impressions served on day $i$
  • $k_i$: clicks recorded on day $i$
  • $p_i = k_i / n_i$: the observed click-through rate (CTR) on day $i$

Your job is to move beyond reading raw percentages and build statistically sound estimates of the overall rate and its uncertainty.

What you need to work through

Part 1 — Overall CTR estimate

Derive the pooled CTR estimator $\hat{p}$ across all 7 days and derive its variance from first principles. Why is this preferable to simply averaging the seven daily rates? What assumptions are you making, and when do they break?

Part 2 — Confidence interval methods

Explain the structural difference between the Wald interval and the Clopper–Pearson interval for a binomial proportion. Describe at least three conditions under which the Wald interval produces unreliable results, and what you would use instead.

Part 3 — Variance of the daily CTRs

You want to quantify how much the true CTR fluctuates from day to day. Explain why sample variance $s^2$ (dividing by $n-1$) should be used instead of population variance $\sigma^2$ (dividing by $n$) for this purpose. Then describe how you would isolate genuine day-to-day variation from pure binomial sampling noise.

Concrete starting point

Day 1 has $n = 1{,}000$ impressions and $k = 50$ clicks, so $p_1 = 0.05$.

  • $SE = \sqrt{p(1-p)/n} = \sqrt{0.05 \cdot 0.95 / 1000} \approx 0.00689$
  • Wald 95% CI: $0.05 \pm 1.96 \times 0.00689 \approx [0.037,\ 0.064]$

Use this as a reference point as you work through the tasks.

What a complete answer looks like

A strong response will: state assumptions explicitly, show the algebraic steps for the variance derivation, compare the two interval methods with enough detail to justify choosing one over the other in a product analytics context, and explain the $n-1$ correction in terms of degrees of freedom rather than just citing "Bessel's correction."

Hints

Hint 1

For Part 1, think of each day's click count as a Binomial random variable. To find the variance of $\hat{p} = K/N$, first find the variance of $K = \sum k_i$ using the independence of days, then apply the scaling rule $\text{Var}(aX) = a^2\text{Var}(X)$.

Hint 2

For Part 2, ask yourself what happens to the Wald formula when $k = 0$ or $k = n$. What does the standard error equal? What does the resulting interval claim about uncertainty? That's the clearest way to see where the normal approximation breaks down.

Hint 3

For Part 3, each observed $p_i$ is a noisy measurement: it mixes a true underlying rate with binomial sampling error. Write $\text{E}[s^2]$ as a sum of real variance and noise variance, then solve for the real variance term.