Skip to content

Finding subgroups honestly

A search over segments always finds one that stands out. Find on one half of the rows and measure on the other, say how many you searched, and test a difference between subgroups directly.

Applied ~14 min10 steps

You will be able to

  • Explain why the best segment of a search looks better than it is
  • Find segments on one half of the rows and measure them on the other
  • Read a segment's score as its size times its gap from the overall rate
  • Report how many segments were searched
  • Tell a real difference between subgroups from two separate p-values

Read first

01

The best of many

Predict

Predict first

A search tries hundreds of segments of your customers, such as "plan = basic and tenure under a year", and reports the one with the highest churn. On next month's customers, what churn rate do you expect in that segment?

About the same rateA lower rate, closer to the overall oneA higher rate
Reveal

The answer: A lower rate, closer to the overall one

A lower rate, closer to the overall one. The search picked the segment because its rate was the most extreme, and part of that was luck. The luck doesn't repeat on new rows, so the gap shrinks.

02

Why the top shrinks

Explore

Every segment's rate is its true rate plus noise. Sort hundreds of them and the top of the list holds the ones whose noise happened to push them up. That's the winner's curseWinner's curseSignificant estimates from small studies overstate the effect, because only large estimates clear the bar., and it's strongest for small segments, whose rates are noisiest.

BExplorable · The winner's curse

Why do significant results from small studies overstate the effect?

Among the significant studies, how many times larger than the truth is the average reported effect?

3.5
How sure?
0.30
20
Simulating…

Commit your prediction above to see the result

Make your prediction first; the figure appears when you commit.

Make your prediction to see the result.

03

Find on one half, measure on the other

Read

The fix is the one you'd use for any idea the data suggested: test it on rows that didn't suggest it. A careful subgroup searchSubgroup searchTries many combinations of column values, such as "plan = basic and tenure < 12", for those whose outcome differs most from the rest. splits the rows in two, the same way every time, into discovery and held-out halvesDiscovery and held-out halvesThe rows are split in two by a hash of their values. The search reads the discovery half; the held-out half measures its rules.. It searches the discovery half only. Then it reports each segment's rate on the held-out half, with an interval, and whether the direction held.

A segment that holds on the second half is a lead worth testing. One that collapses was mostly luck. Neither half is new data, so a lead still needs a planned test.

04

Segments in Insights

In the app

Pick a Target in the Insights header, and Segments appears in the rail. Choose whether to look for a Higher or Lower target, how many conditions a rule may have, and the smallest subgroup.

Each rule shows its rate on the held-out half with a 95% band, its rate on the discovery half, and a badge: Held up on the held-out half or Didn't hold up on the held-out half. Its q-tier is marked exploratory. The summary says how many subgroups were searched.

Show these rows opens the subgroup in the Data tab, and Compare with the rest opens it on Compare.

05

How a segment is scored

Checkpoint

A search needs a score that doesn't favor tiny segments with extreme rates. WRAccWeighted relative accuracyHow much a subgroup stands out, weighted by its size: coverage × (the target's rate or mean in the subgroup − its rate or mean overall). multiplies a segment's share of the rows by how far its rate is from the overall rate:

WRAcc=nsN(yˉs−yˉ)\text{WRAcc} = \frac{n_s}{N}\left(\bar y_s - \bar y\right)

A segment of three customers who all churned has a huge gap and a tiny share, so it scores low.

Check yourself

A segment holds 10% of the rows. Its churn rate is 40% and the overall rate is 20%. What is its WRAcc?

Show the answer

Answer: 0.02

0.10 × (0.40 − 0.20) = 0.02. A segment holding 1% of the rows would need a gap twenty times larger to score the same.

06

Say how many you searched

Reflect

"Basic-plan customers in their first year churn twice as often" sounds like a finding. "The best of 480 segments we searched" sounds like what it is. The number searched is the denominator of the claim, as the number of tests is for a p-value.

Report the number searched, the held-out rate with its interval, and the label "exploratory". If you chose a segment to act on, which of these three would your audience need to hear first?

Pin the leads you keep. The Journal in Insights lists every pin, and pins with a p-value get q-values under "These were looks, not planned tests."

07

Significant here, not there

Predict

Predict first

A treatment's effect is significant for women and not significant for men. Does that show the treatment works differently by sex?

Yes: it works for women and not for menNo: that needs a test of the difference itselfOnly if the samples are the same size
Reveal

The answer: No: that needs a test of the difference itself

No. One group may have fewer rows, so its test has less power. The question is whether the two effects differ, which is a test of an interactionInteractionWhen the effect of one predictor depends on the level of another.: one model with treatment, sex and treatment × sex. Its interval for the difference is the answer.

08

Planned subgroups

In the app

The subgroups that carry weight are the ones you named before the data: a few, each with a reason, in a plan you locked. In Guided, put them in the question before you switch to Confirm, so their tests get their own family.

Test a difference between groups with an interaction in a model, not with two p-values.

09

Check your understanding

Checkpoint

Check yourself

A segment's churn is 31% on the discovery half and 22% on the held-out half, against 20% overall. What's the honest reading?

Show the answer

Answer: b

The held-out rate is the one the search couldn't tune itself to. It says the segment is only slightly above average, if at all.

Check yourself

Which sentence reports a segment search honestly?

Show the answer

Answer: b

It gives the denominator, the held-out rate with its interval, and the baseline, and it claims no more than an exploratory lead.

Check yourself

Which segment's rate do you trust least?

Show the answer

Answer: c

Small segments have the noisiest rates, so they dominate the top of a search by luck. Twelve rows can be 75% with nothing behind it.

10

Recap

Recap
  • The best segment of a search is the luckiest as well as the strongest, so its gap shrinks on new rows.
  • Find on one half, measure on the other, and say how many segments you searched.
  • WRAcc weighs a segment's gap by its size, so tiny extreme segments don't win.
  • A difference between subgroups is a test of an interaction, not two p-values.

Concepts in this lesson