Sub topic 6
Building benchmarks: medians, percentiles, and gaps
By this point you have chosen goals, built a competitor set, defined engagement rate, collected public data, and normalized it. This chapter turns those normalized numbers into benchmarks and gaps you can defend. It assumes you can compute a per-post engagement rate and that you know what a median is. It also assumes your competitor data is already in a form where every account has a comparable rate.
What a benchmark is
A benchmark is a reference value computed from your competitor set. You compare your own result against it. A benchmark answers one question: "Where do we stand relative to comparable accounts?" It does not say why you stand there. That comes later, in content analysis and action planning.
A useful benchmark has three parts:
- A central value, which says what is typical for the set.
- A spread, which says how much accounts differ from each other.
- A gap, which says how far you are from the central value, expressed in a way a decision-maker can read.
The diagram below shows the order of calculation used in this chapter.
Why the median, not the mean
Social media metrics are skewed. A single post that goes viral can have ten times the engagement of a typical post. A single competitor with an unusually engaged audience can sit far above the rest. The mean (the arithmetic average) is pulled toward these extremes. The median, the middle value when you sort the data, is not.
Consider seven peer accounts with these account-level engagement rates: 0.95%, 1.40%, 1.80%, 2.10%, 2.60%, 3.20%, and 5.00%. The median is 2.10%. The mean is 2.44%. The one 5.00% account lifts the mean above five of the seven peers. If your rate is 2.25%, the mean says you trail the group. The median says you are slightly ahead. The median describes the typical peer better here.
Use these defaults:
- Use the median as the central value for engagement rate and similar ratios.
- Use the mean only for metrics that are roughly symmetric, or when you specifically want totals, such as total mentions.
- Report the mean next to the median when they differ a lot. The difference itself tells you the set is skewed.
Two levels of aggregation
You have posts inside accounts, and accounts inside a peer set. You need to decide how to collapse both levels.
The standard approach is two steps:
- Compute each account's median per-post rate. This limits the effect of one viral post.
- Compute the median across accounts (or quartiles across accounts) to get the benchmark.
Avoid pooling every competitor post into one list and taking a single median. An account that posts 40 times in the period would then count for ten times more than an account that posts 4 times. The benchmark would mostly describe your most prolific competitor. Two-step aggregation gives each account one vote.
The first code example from this tutorial's plan produces the account-level medians. Each post is a tuple of likes, comments, and shares, and the rate is engagements divided by followers.
from statistics import median
accounts = {
"us": {"followers": 20000, "posts": [(400, 30, 20), (250, 10, 5), (610, 55, 40)]},
"rival_a": {"followers": 50000, "posts": [(900, 60, 30), (700, 40, 20), (1200, 90, 70)]},
"rival_b": {"followers": 8000, "posts": [(300, 25, 15), (150, 8, 4), (420, 30, 22)]},
}
def median_engagement_rate(followers, posts):
# Each post is (likes, comments, shares); rate is engagements per follower.
return median(sum(p) / followers for p in posts)
rates = {name: median_engagement_rate(a["followers"], a["posts"]) for name, a in accounts.items()}
for name, rate in rates.items():
print(name, round(rate * 100, 2), "%")The output is us 2.25 %, rival_a 2.0 %, and rival_b 4.25 %. Each account is now represented by one number. Those numbers feed the next step.
The gap to the peer median
The simplest gap is the difference between your rate and the peer median. Subtract in the same units, and say "percentage points" (pp) when you subtract two percentages. A move from 2.0% to 3.0% is a gain of 1 percentage point and a relative increase of 50%. Mixing those two phrases is a common reporting error.
from statistics import median
rates = {"us": 0.0225, "rival_a": 0.0180, "rival_b": 0.0500}
peer_rates = [r for name, r in rates.items() if name != "us"]
peer_median = median(peer_rates)
gap = rates["us"] - peer_median
print("peer median:", round(peer_median * 100, 2), "%")
print("gap to peer median:", round(gap * 100, 2), "percentage points")This prints a peer median of 3.4% and a gap of -1.15 percentage points.
Note two details in this code. The peer list excludes your own account, so you are not part of the benchmark you are measured against. And with only two peers, the median is just their average, which is a weak benchmark. The sections below explain what to do about that.
Three ways to express a gap
| Form | Formula | Example | Best used for |
|---|---|---|---|
| Absolute gap | yours − benchmark | +0.15 pp | Precise comparison in the metric's own units |
| Relative gap | (yours − benchmark) ÷ benchmark | +7.1% | Communicating size of difference to non-analysts |
| Ratio | yours ÷ benchmark | 1.07× | Targets and quick scans across many metrics |
Report the absolute gap and the relative gap together. An absolute gap of 0.15 pp sounds trivial, but when the benchmark is 0.4%, it is a 37% relative difference. The relative gap alone can mislead in the other direction when the benchmark is tiny.
Percentiles and quartiles
The median tells you the middle. Percentiles tell you the shape around it. The 25th percentile (Q1) is the value below which a quarter of peers fall. The 75th percentile (Q3) has three quarters below it. The distance from Q1 to Q3 is the interquartile range (IQR), which covers the middle half of the peer set.
Two readings are useful:
- Position in the range. Are you below Q1, between Q1 and Q3, or above Q3? A gap of 0.3 pp means little if the IQR is 3 pp wide, because you sit well inside the normal range. The same gap means a lot if the IQR is 0.4 pp wide.
- Percentile rank. The share of peers your value beats. If you beat 4 of 7 peers, your rank is about 57%.
Python's standard library computes quartiles with statistics.quantiles. Use method="inclusive" for small samples, because the default "exclusive" method can produce quartile values that fall outside the observed range when there are few data points.
from statistics import mean, median, quantiles
our_rate = 0.0225
peers = {
"a": 0.0180, "b": 0.0500, "c": 0.0210, "d": 0.0095,
"e": 0.0320, "f": 0.0140, "g": 0.0260,
}
values = sorted(peers.values())
q1, q2, q3 = quantiles(values, n=4, method="inclusive")
below = sum(v < our_rate for v in values)
percentile_rank = below / len(values) * 100
abs_gap = our_rate - median(values)
rel_gap = abs_gap / median(values) * 100
print(f"Q1 {q1*100:.2f}% median {q2*100:.2f}% Q3 {q3*100:.2f}%")
print(f"mean {mean(values)*100:.2f}%")
print(f"our rate {our_rate*100:.2f}% beats {below} of {len(values)} peers ({percentile_rank:.1f}th percentile rank)")
print(f"gap to median: {abs_gap*100:+.2f} pp ({rel_gap:+.1f}%)")
print(f"gap to mean: {(our_rate - mean(values))*100:+.2f} pp")The output is:
Q1 1.60% median 2.10% Q3 2.90%
mean 2.44%
our rate 2.25% beats 4 of 7 peers (57.1th percentile rank)
gap to median: +0.15 pp (+7.1%)
gap to mean: -0.19 ppRead this as a short report. You are slightly above the typical peer, inside the middle half of the set (1.60% to 2.90%), and ahead of just over half the peers. The mean-based gap points the other way because of the 5.00% account. Showing both makes that skew visible.
When the sample is too small
Percentiles need enough points to mean anything. The rough limits are:
- Fewer than 5 peers: do not report quartiles or percentile ranks. Report the individual values in a table and the median as a reference only.
- 5 to 9 peers: report the median and the Q1 to Q3 range, but treat percentile rank as approximate. One account moving can change your rank by 10 points or more.
- 10 or more peers: percentiles are reasonably stable.
Small sets are normal in competitive benchmarking. The remedy is to say so, not to hide it. A line such as "Benchmark based on 6 peers; one account's change shifts the median by about 0.3 pp" is more honest than a precise-looking number.
Tiers, direction, and ties
Three details change how you read a percentile.
Size tiers. Engagement rate often falls as follower count rises, because large audiences include more passive followers. If your peer set mixes accounts with 8,000 and 500,000 followers, a single median blends two different behaviors. The previous chapter's normalization reduces this effect but does not remove it. When you have enough peers, compute the benchmark inside a size tier, for example accounts within half to double your follower count, and note the tier in the report.
Metric direction. For engagement rate, higher is better. For some metrics, such as median response time to customer comments, lower is better. Flip the sign or the rank before you present a "gap," so a negative number always means you are behind.
Ties and strict comparison. The percentile rank above counts peers strictly below you. If a peer has exactly your value, decide whether to count ties as half. Pick one rule, document it, and keep it for every review period so results stay comparable.
Checking that the gap is real
A gap is an observation, not yet a finding. Before you act on it, run three checks:
- Spread of your own posts. If your per-post rates range from 1.3% to 3.5%, as in the first example, a 0.15 pp gap is well within your own normal variation.
- Sensitivity. Remove one peer at a time and recompute the median. If the sign of your gap flips, the result is fragile.
- Period stability. Compare against the previous period. A gap that appears in only one period may come from a campaign, a holiday, or a single viral post.
from statistics import median
our_rate = 0.0225
peers = [0.0180, 0.0500, 0.0210, 0.0095, 0.0320, 0.0140, 0.0260]
for i in range(len(peers)):
remaining = peers[:i] + peers[i + 1:]
gap_pp = (our_rate - median(remaining)) * 100
print(f"drop peer {i}: gap {gap_pp:+.2f} pp")If every line shows a positive gap, the finding survives the removal of any single peer. If some lines are positive and others negative, report the gap as "about even."
Common errors in this step
- Including your own account in the peer median, which pulls the benchmark toward you and shrinks the gap.
- Averaging account-level rates that were computed on different follower dates or different post windows.
- Pooling all posts instead of taking per-account medians first.
- Reporting a relative gap and calling it percentage points.
- Reporting percentile ranks from three or four peers.
- Using the default exclusive quartile method on a small set and getting quartiles outside the data range.
Exercise
Your engagement rate is 1.90%. Four peers have rates of 1.20%, 1.80%, 2.00%, and 4.50%. Compute the peer median, the peer mean, and your gap to each in percentage points. Which gap better describes your position, and why?
Show answer
The sorted peer values are 1.20, 1.80, 2.00, and 4.50. The median is (1.80 + 2.00) / 2 = 1.90%, so the gap to the median is 0.00 pp. The mean is (1.20 + 1.80 + 2.00 + 4.50) / 4 = 2.375%, so the gap to the mean is 1.90 − 2.375 = −0.475 pp. The median gap describes your position better, because the 4.50% peer pulls the mean above three of the four peers. You are level with the typical peer. With only four peers, you should also show the raw values and not report percentiles.
Exercise
A colleague pooled every competitor post (about 150 posts across 5 accounts, one of which contributed 90 posts) into one list and reported its median as the benchmark. Name the problem and describe the fix.
Show answer
The pooled median is dominated by the account that posted 90 times, so it mostly describes that one competitor and not the peer set. The fix is two-step aggregation. First compute each account's median per-post engagement rate, so each account has one value. Then take the median (and Q1 and Q3) across those five account values. State that the set has only five peers, so percentile ranks are approximate.