Handling Skewed, Zero-Inflated Revenue Metrics in A/B Tests
Statistics & ExperimentsModel answerLast updated
Select and justify statistical inference methods for a revenue metric plagued by zero-inflation, heavy tails, and unequal variance between treatment arms.
Scenario
Your team ships a new in-app feature intended to grow revenue per user session. After the experiment concludes, you examine the primary metric and notice three things:
- Lots of zeros. Roughly 30% of users in both arms opened the app but never completed a purchase, producing an exact value of $0.
- Right-skewed non-zero values. Among users who did buy, a small number of high-spend users pull the distribution far to the right.
- Unequal variance across arms. The treatment arm has noticeably higher spread than the control arm, which is typical when a feature shifts some users toward much larger baskets.
What you are asked to do
- Explain concretely why a standard two-sample t-test produces unreliable p-values and confidence intervals under these three conditions.
- Propose two distinct inferential approaches that address these problems. For each one:
- Describe how it handles the zeros and the skewness.
- State what quantity it actually estimates (the estimand).
- Explain how you would interpret the resulting effect size in business terms, and flag any common misinterpretation traps.
A strong answer stays anchored to what the business cares about measuring, rather than defaulting to a convenient test without asking what its output means.
Hints
Hint 1
Start by listing the t-test's assumptions one by one and map each assumption to a specific problem in this data. Heteroskedasticity, slow CLT convergence, and a mixture distribution are three separate failure modes — treat them separately before discussing fixes.
Hint 2
For Approach 1, ask yourself whether you need to change the estimand or just make inference more robust around the raw mean difference. The bootstrap can do the latter, but not all bootstrap intervals handle skewness equally well — think about which variant corrects for asymmetric coverage error.
Hint 3
For Approach 2, notice that E[Y] = P(Y > 0) × E[Y | Y > 0]. That factorization suggests modeling two processes instead of one. If you use a log transform on the positive values, be very careful about what exp(β) actually represents when the two arms have different variances — this is the retransformation trap.
Model answer
Hard Try it yourself first — then compare your approach, complexity and edge cases.
Why the standard t-test breaks here
The two-sample t-test (even Welch's variant) rests on the assumption that the sample mean is approximately normally distributed, which the CLT eventually guarantees — but "eventually" is the operative word.
Heteroskedasticity inflates or deflates the standard error. The pooled-variance t-test weights each group's variance by sample size. When the treatment arm has higher variance, the pooled SE is wrong in a direction that depends on which group is larger. Welch's correction fixes the degrees of freedom but still relies on an accurate per-arm variance estimate, which the next two issues undermine.
Heavy tails make the variance estimate unstable. A single whale — a user spending $2,000 — can dominate the sample variance. The SE fluctuates experiment to experiment, and convergence of the t-statistic to its nominal distribution is very slow. An Edgeworth expansion shows the error in the t-distribution approximation is of order γ/√n, where γ is the skewness coefficient. With strongly skewed revenue, n needs to be very large before the approximation is trustworthy.
Skewness creates asymmetric coverage errors. Because large spend and large variance occur together (a power user pushes up both the sample mean and the sample SD in the same draw), the two-sided confidence interval may have roughly correct overall width while each tail is off. Per-tail error rates and one-sided tests can be far from nominal.
Zero-inflation creates a mixture distribution. The data is a point mass at 0 mixed with a skewed continuous distribution. The t-test treats this as a single distribution and cannot distinguish "the feature converted more users" from "buyers spent more." These have different product implications and different remedies.
Approach 1: Robust inference on the mean difference
The business usually wants Δ = E[Y_T] − E[Y_C] in dollars per session, because it multiplies directly into revenue. Keep that estimand and make the inference procedure robust rather than switching to a different quantity.
Point estimate: the raw difference in sample means, Ȳ_T − Ȳ_C. Zeros are included and handled naturally; no special treatment is needed.
Inference: resample users within each arm independently (respecting the unequal variances) using the bootstrap. Use a BCa or studentized bootstrap-t interval, not the plain percentile interval. Both reduce coverage error to order 1/n rather than 1/√n by correcting for the skewness-induced asymmetry in the sampling distribution.
Variance reduction: because skewed revenue has high intrinsic variance, power is a real concern. CUPED (using pre-experiment spend as a covariate) typically removes a large fraction of residual variance without changing the estimand. Winsorizing at a pre-specified pooled percentile (say, the 99.5th) also helps, but changes the estimand to a capped mean — report that honestly.
Permutation test caveat: a plain permutation test assumes the two distributions are exchangeable under the null, meaning identical in shape and spread. With unequal variances, it does not validly test equality of means. A studentized permutation test — which permutes the Welch t-statistic rather than raw values — is the correct version.
Interpretation: "Treatment increased average spend by $X per session (95% CI [$a, $b])." Also report relative lift, Δ / Ȳ_C, with a bootstrap CI.
Approach 2: Two-part (hurdle) model
Because E[Y] = P(Y > 0) · E[Y | Y > 0], the zero-inflation suggests splitting the problem into two separately interpretable components.
Part 1 — Participation: estimate the difference in conversion rates, P(Y > 0), with a difference in proportions or logistic regression. This is a clean causal estimate.
Part 2 — Intensity: estimate the treatment effect on spend among buyers only. Two options:
- Gamma GLM with a log link (preferred). Models E[Y | Y > 0] directly, with variance proportional to the mean squared — a natural fit for revenue. The coefficient exp(β) is the ratio of conditional means, which has a direct dollar interpretation.
- OLS on log(Y) for Y > 0. Simpler, but carries the retransformation trap.
The retransformation trap in detail. If log(Y) is roughly normal with arm-specific means and variances, then E[Y | Y > 0] = exp(μ + σ²/2). Because the two arms have different σ², exp(μ_T − μ_C) is the ratio of geometric means, not arithmetic means. A treatment can raise the geometric mean while leaving the arithmetic mean flat or even reducing it. If you need dollar-level predictions, apply Duan's smearing estimator separately per arm, or use the Gamma GLM and sidestep the problem.
Combining the parts: the total unconditional effect is Δ = p_T · μ₊,T − p_C · μ₊,C. Bootstrap the full pipeline to get a CI for this quantity.
Interpretation: "Conversion rose 2.1 percentage points; conditional spend among buyers rose 4% (ratio of conditional means); the combined effect is approximately +$0.85 per session."
Important caveat on the conditional part: the intensity comparison compares selected populations — the set of buyers may differ between arms if the feature induces marginal buyers with smaller baskets. A negative intensity effect does not necessarily mean existing buyers spent less. The conditional estimate is descriptive; only the combined Δ is fully causal.
Why not Mann-Whitney as the primary test?
Mann-Whitney tests whether P(Y_T > Y_C) ≠ 0.5, not a difference in means or medians. It is not robust to unequal variances when used as a location test, it handles the 30% tied zeros awkwardly, and its output does not map to a revenue number. It is a useful sensitivity check, not a primary analysis.
Recommended structure
- Primary analysis: mean difference with BCa bootstrap CI plus CUPED for variance reduction.
- Secondary analysis: two-part model to decompose the effect into conversion and intensity.
- Sensitivity checks: Mann-Whitney, winsorized mean, pre-registered outlier handling.
The key discipline throughout is stating the estimand before choosing the method — and checking that the output can be translated back into a business decision.