Hi, What is the difference between these two metr...
# ask-questions
i
Hi, What is the difference between these two metric definitions? 1. Ratio metric with
Numerator = SUM(profit per order)
,
Denominator = Unique Users
2. Mean metric with
per user aggregation = SUM(profit per order)
. When defining the Mean metric (2), the Growthbook interface says:
The final metric value will be the average per-user value for all users in the experiment. Any user without a matching row will have a value of 0 and will still contribute to this average.
So I don't understand the difference between a denominator of "Unique Users" in 1 and "average per-user value" in 2. I would expect these two metrics to be identical. However, on the experiment overview page I can see they have the same numerator value (1.7m), but the Ratio (1) has 5k Unique Users for the Denominator, while Mean (2) has a denominator of 83k. We're doing an A/A test (no difference between the two treatments) and are seeing Growthbook report a statistically significant Relative uplift for the Ratio Metric, but not for the Mean metric. I would like to understand the details of what is happening behind the scenes a bit better.
I also asked the question to Copilot, providing the slack question, growthbook html docs and SQL queries as context. The answer seems reasonable: Looking at your SQL queries, I can now explain the key difference between these two metrics: ## The Core Difference Ratio Metric (1): Only includes users who have at least one order in the denominator (5k users) Mean Metric (2): Includes all users exposed to the experiment in the denominator (83k users), even if they never placed an order ## How This Happens in the SQL ### Ratio Metric Query
Copy code
sql
-- In __userMetricAgg:
SELECT
  umj.variation,
  umj.client_id,
  SUM(COALESCE(umj.m0_value, 0)) AS m0_value,
  COALESCE(MAX(umj.m0_denominator), 0) AS m0_denominator  -- Key line
FROM __userMetricJoin umj
GROUP BY umj.variation, umj.client_id
Notice
m0_denominator
in the fact table is set to
1
for each order row. When aggregating: • Users with orders get
MAX(m0_denominator) = 1
• Users without orders get
MAX(NULL) = NULL
, then
COALESCE(NULL, 0) = 0
In the final aggregation:
Copy code
sql
SUM(COALESCE(m.m0_denominator, 0)) AS m0_denominator_sum
Only users with
m0_denominator = 1
contribute to the denominator. Users with zero orders are excluded. ### Mean Metric Query
Copy code
sql
SELECT
  m.variation AS variation,
  COUNT(*) AS users,  -- This counts ALL exposed users
  ...
The denominator is simply
COUNT(*)
of all users in
__userMetricAgg
, which includes every user from
__distinctUsers
(all experiment exposures), regardless of whether they have orders. ## Why This Matters for Your A/A Test With 83k total exposed users but only 5k with orders: Ratio Metric: 1.7M / 5k ≈ $340 per purchasing user • Higher variance (smaller sample size) • More likely to show false positives in A/A test Mean Metric: 1.7M / 83k ≈ $20 per exposed user • Lower variance (larger sample size) • More stable, less likely to show false significance ## Which Should You Use? Use Ratio Metric when you want to understand: • “Among users who purchased, how much did they spend?” (Average Order Value style metrics) Use Mean Metric when you want to understand: • “What’s the average value per user exposed to the experiment?” (True per-user impact) For most A/B tests, Mean metrics are more appropriate because they measure the true causal impact per user exposed, including those who didn’t convert (which is often the effect you’re trying to change).
f
that seems correct
i
Thanks for confirming.