Problem
Some success metrics cannot be measured on the whole population because the data is expensive or slow to collect. A team then tracks a sampled metric every month and asks whether a dip or a rise is real. A one-shot sample-size formula does not answer this, because confidence builds up across a series of data points. A small sample sends the team chasing noise. A large one burns audit budget.
Example from the article: Shopify wants to know how many requirements the average installed app violates (the "shop issue rate"). It cannot audit thousands of apps every month, so it audits a random sample and needs to know how many audits are enough.
Solution in brief
Simulate the metric before collecting it. Draw many fake monthly samples from an assumed distribution with an assumed true monthly improvement, and measure how often the sampled metric shows the improvement. Repeat over a grid of sample sizes and improvement rates. The result is a table of certainty by sample size.
Questions this case answers
- How to choose the sample size for a metric that is tracked over time from a sample, when the trend must be separated from sampling noise and each extra observation costs money
- How to tell whether a month-over-month change in a sampled success metric is real or sampling noise?
- How to decide how many items to audit each month to trust a sampled quality metric?
- How to explain the trade-off between sample size and data collection cost to non-technical stakeholders?
Tools and methods
- Monte Carlo simulation — repeated random sampling to see how a sampled metric behaves under assumed conditions.
- Poisson distribution — model for the number of issues per audited app; it has one parameter, .
- Simulation metrics (MAPE, 1mDO, 2mDO, 1qDO) — measure how noisy the sampled metric is.
- pandas — builds the simulated time series and the parameter grid.
Google or a one-time email code. No password.