Percentile Metrics
Percentile metrics in Statsig Warehouse Native compute p50, p90, p95, and custom percentiles of a numeric column for latency and tail-value analysis.
Use cases
The mean of a metric can be acceptable while the tail end (for example, the 99th percentile) is not. Consider a website with an average TTL of 300ms but a p99 TTL of 1 minute. A small portion of the population has an unusable experience that doesn't appear in the mean, making it difficult to measure whether the p99 value changed with traditional A/B/n metrics.
Percentile metrics are common as guardrail metrics for performance regression, and for measuring improvements from investments in performance and infrastructure.
Calculation
For percentile metrics, there is no unit-level calculation; Statsig runs the analysis at the group level.
The SQL looks like the following:
-- Group Level
SELECT
exposures_data.group_id,
PERCENTILE(user_data.value, percentile_level) as value,
COUNT(distinct user_data.user_id) as population
FROM user_data
JOIN exposure_data
ON
-- Only include users who saw the experiment
source_data.unit_id = exposure_data.unit_id
-- Only include data from after the user saw the experiment
-- In this case exposure_data is already deduped to the "first exposure"
AND source_data.timestamp >= exposure_data.timestamp
WHERE value IS NOT NULL
GROUP BY group_id;
Methodology notes
Percentile metrics use the outer CI method to estimate a confidence interval and significance. Deng et al. describe the methodology in section 4 of this paper.Some metrics aren't well-formed for this approach, because the method assumes the underlying distribution is continuous. For example, if your data has 1/3 of rows with a value of 0, 1/3 with a value of 5, and 1/3 with a value of 10, Statsig doesn't calculate significance for a median or p99 metric because there is no local variability.
Options
- Metric Breakdowns
- You can configure Metadata Columns to group results by, getting easy access to dimensional views in pulse results
Was this helpful?