Watch-Time Sample: Skew, Percentiles, and Winsorizing
Statistics & ExperimentsModel answerLast updated
Analyze a 20-point video watch-time sample: judge its shape, compute median, mode and an interpolated p95, compare mean and median, and reason about winsorizing in an A/B test.
You are choosing a primary metric for an experiment on a video product, and you settle on watch time per video, in seconds. A small pilot gives these 20 observations:
3, 5, 6, 6, 7, 8, 9, 10, 12, 15, 16, 20, 24, 30, 35, 45, 60, 90, 120, 180
Answer the following:
- Shape. Describe the likely distribution: its skew and how heavy its tail is. Explain how you would sketch it in words and which numbers support your claim.
- Summary numbers. Compute the sample median, the mode, and the 95th percentile using linear interpolation between order statistics. Show your steps and state which quantile convention you used.
- Mean vs. median. Compare the two on this data. Argue which is the more robust basis for product decisions, and say whether your answer depends on the business goal.
- Winsorizing. Suppose you cap values at the 99th percentile before analysis. Explain qualitatively how this changes the variance of the metric, the statistical power of an A/B test, and the quantity you are actually estimating.
Hints
Hint 1
Compare the mean to the median and look at how much of the total comes from the largest few values. Also consider what the data would look like on a log scale.
Hint 2
For an interpolated quantile at probability p with n points, the default in NumPy and R is position h = (n-1)p + 1 on the sorted list. Interpolate between the two neighbouring order statistics, and note that other conventions give different answers.
Hint 3
Ask what happens to each estimator if the largest value is replaced by something ten times bigger. Then ask what the business actually sums up: typical views, or total watch time?
Hint 4
For winsorizing, think about three things separately: how variance changes, how that feeds into the standard error and minimum detectable effect, and what bias the cap introduces if the treatment acts on long views.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
1. Shape of the distribution
The sorted sample has n = 20 values from 3 to 180.
It is strongly right-skewed with a heavy upper tail. The supporting evidence:
- Mean vs. median. The mean is 701 / 20 = 35.05 s, more than double the median of 15.5 s. A mean far above the median is the standard sign of right skew.
- Tail dominance. The three largest values (90, 120, 180) add up to 390 s, about 56% of the total from 15% of the observations.
- Spread. The sample SD is about 45.9 s (variance about 2,110), larger than the mean, so the coefficient of variation is about 1.3. The range spans a factor of 60.
- Natural bounds. Watch time is floored at 0 and effectively unbounded above, which pushes data into a right tail.
- Skewness. The moment-based skewness is roughly +2.
Verbal sketch. Most of the mass sits in a tall cluster between about 3 and 20 s, with a peak around 6 to 10 s. A thin tail then stretches out through 30, 45, 60, 90 and on to 180. On a log axis the picture looks much more symmetric, which suggests a log-normal-like shape, common for dwell times. Real production data would also show a spike near zero (instant swipes) and a ceiling at video length.
2. Median, mode, 95th percentile
Median. For even n, average the 10th and 11th order statistics: (15 + 16) / 2 = 15.5 s.
Mode. Only 6 repeats (twice), so the mode is 6 s. With continuous data and 20 points this is a fragile statistic. A density estimate would place the peak somewhere in the 6 to 10 s zone.
95th percentile, linear interpolation (Hyndman-Fan type 7, the NumPy/R/Excel-inclusive default).
- Position h = (n − 1)p + 1 = 19 × 0.95 + 1 = 19.05.
- The neighbours are x₍₁₉₎ = 120 and x₍₂₀₎ = 180.
- Q(0.95) = 120 + 0.05 × (180 − 120) = 123 s.
Always name the convention. Type 6 uses h = p(n + 1) = 19.95 and gives 120 + 0.95 × 60 = 177 s. The two conventions differ by more than 50 s because at n = 20 the p95 depends on just the top two points. A tail quantile from a sample this small is very unstable, so in practice report it with a bootstrap confidence interval.
3. Mean vs. median
| Statistic | Value | If the max 180 became 1,800 |
|---|---|---|
| Mean | 35.05 | 116.05 |
| Median | 15.5 | 15.5 |
Why the median is more robust.
- Breakdown point. The median tolerates up to 50% contamination, while the mean tolerates none. One bot, autoplay loop or logging bug can drag the mean anywhere.
- Representativeness. The mean of 35 s is higher than 15 of the 20 observations, so it does not describe a typical view.
- Decision stability. With heavy tails the sampling variance of the mean is dominated by a few points, so a conclusion drawn from it can flip on noise.
The caveat. "More robust" is not the same as "better for the decision." If the business cares about total watch time (ad inventory, engagement hours), then the mean is the right estimand, because total = mean × number of views. A treatment that stretches some 60 s views to 300 s adds real value that the median would not see at all.
A sensible practice combines both:
- Use the median and quantiles (p25, p75, p90, p99) to describe the distribution and detect shifts in typical behavior.
- Use a mean-based primary metric for the experiment, stabilized by winsorizing, a log transform or a trimmed mean, plus variance reduction such as CUPED.
- Treat quantile tests as secondary diagnostics. They need bootstrap or quantile regression, while mean tests have simple variance formulas and aggregate cleanly across segments.
4. Winsorizing at the 99th percentile
Winsorizing replaces every value above Q(0.99) with Q(0.99).
On this sample. Using type 7, h = 19 × 0.99 + 1 = 19.81, so Q(0.99) = 120 + 0.81 × 60 = 168.6 s. Only the value 180 gets capped. The mean falls by 11.4 / 20 = 0.57 to about 34.5 s, and the SD shrinks slightly. With 20 points the p99 is essentially the maximum, so the effect is small. The technique matters at production scale.
Effects in an A/B test.
- Variance falls, sometimes a lot. Squared deviations from the far tail dominate the variance, so capping the top 1% can remove a large share of it.
- Power rises. The standard error of a difference in means is √(σ²_T/n_T + σ²_C/n_C). Smaller σ² gives a smaller minimum detectable effect at the same sample size, or the same sensitivity with less traffic or a shorter run.
- The estimand changes and bias enters. You are now comparing winsorized means. If the treatment mainly lengthens already-long sessions, the cap attenuates or hides that effect. The choice of cap is a bias-variance trade-off, and a 1% cap typically buys a lot of precision for modest bias.
Practical rules.
- Set the cap from pre-experiment data or pooled control and treatment data, not separately per arm, so the treatment cannot move its own threshold.
- Fix the cap level in advance rather than tuning it after seeing results.
- Winsorize at the randomization unit (for example per-user total watch time) rather than per video, otherwise variance estimates are wrong.
- Combine with CUPED using pre-period watch time.
- Run a sensitivity analysis with the uncapped mean and upper quantiles so a genuine tail effect is not silently discarded.
Common mistakes
- Reporting a percentile without the interpolation convention, or using nearest-rank when interpolation was requested.
- Declaring "median is always better" without linking the metric to the business goal.
- Computing the mode from a tiny continuous sample and treating it as meaningful.
- Winsorizing per arm, per video instead of per user, or after peeking at results.
- Forgetting that winsorizing changes what is being estimated, not just the noise level.