Find out who benefited most from a program

analyze-heterogeneous-effects

Analyzev0.3.0atomicdraftThe Agency Fund

Estimates how a program's effect differed across the people it reached.

What this adds: keeps the subgroups the analysis plan named apart from every other split, and never moves one across; corrects for testing several; fits any machine-learning search on one random half of the sample and checks it on the other; reports effects in the outcome's units; reads a null difference as "not detectable"; and refuses to turn a result into a rule for who gets the program.

Expert reviews are for staff at The Agency Fund and Irrational Labs; anyone can rate.

Skill

The instructions your AI follows when this skill runs. Installing the skill gives it this file and everything in the other tabs.

SKILL.mdView on GitHub

Takes in

analysis-planAnalysis planFrom write-pre-analysis-plandataset-descriptionDataset description
analyze-heterogeneous-effects

Produces

heterogeneity-reportHeterogeneity report

See it on the map

Install

/plugin marketplace add agency-fund/besci-skills
/plugin install besci-skills@besci-skills

What it does

Estimates how a program's effect differed across the people it reached.

What this adds: keeps the subgroups the analysis plan named apart from every other split, and never moves one across; corrects for testing several; fits any machine-learning search on one random half of the sample and checks it on the other; reports effects in the outcome's units; reads a null difference as "not detectable"; and refuses to turn a result into a rule for who gets the program.

A subgroup is defined by a characteristic measured before the program began, such as sex or starting score.

When to use it

Use it when

  • A trial has an overall effect and someone asks "who did it work for?"
  • The analysis plan named subgroups, and they now need testing
  • Someone proposes "the main effect was null, let's check the subgroups" after seeing the results
  • The team wants a causal forest or another machine-learning method to find who responds

Do not use it when

  • The subgroups are still being chosen before the trial; use write-pre-analysis-plan
  • The question is the sample needed to detect a subgroup difference; use estimate-sample-size
  • The question is whether the effect will hold at scale; use assess-scalability

Before you start

Ask these before producing the report. Do not ask anything the user has already answered.

  1. Required. The analysis plan (outcome, model, and the subgroups it names with their expected direction), or a statement that there is none.
  2. Required. A description of the data: arms, unit of randomization, sample per arm, baseline characteristics, the outcome's units, and how the sample was drawn.
  3. Optional. The data or regression output, and the software in use.
  4. Optional. The decision the result informs: description, what to pre-register, or who gets the program.

If 2 is missing, ask and stop. With no plan, label every result exploratory. If 3 is missing, write the analysis code and leave the numbers to fill in. If 4 is missing, assume description.

What it draws on

  • Skivington, K., Matthews, L., Simpson, S. A., et al. (2021). A new framework for developing and evaluating complex interventions: update of Medical Research Council guidance. BMJ, 374, n2061. https://doi.org/10.1136/bmj.n2061 Supports: reporting prespecified subgroup analyses, even underpowered ones.
  • Haynes, L., Service, O., Goldacre, B., & Torgerson, D. (2012). Test, Learn, Adapt. Cabinet Office. https://www.gov.uk/government/publications/test-learn-adapt-developing-public-policy-with-randomised-controlled-trials Supports: choosing subgroups at the outset, and treating an unexpected trend as a reason for a new trial.
  • Chernozhukov, V., Demirer, M., Duflo, E., & Fernández-Val, I. (2025). Fisher–Schultz Lecture: Generic machine learning inference on heterogeneous treatment effects in randomized experiments, with an application to immunization in India. Econometrica, 93(4), 1121–1164. https://doi.org/10.3982/ECTA19303 Supports: the three exploratory outputs and repeated splitting.

Where the evidence comes from: The procedure is statistical and makes no claim about how people behave. The machine-learning method was demonstrated on an immunization trial in Haryana, India; the trial guidance comes from the United Kingdom. What is local is the sample: a result speaks for a wider population only if the trial drew its people from it at random.

Replication status: Not applicable to the methods; subgroups chosen after the data lack power and validity, so unplanned results are labeled hypotheses.

How to do it

  1. Copy the plan's subgroups verbatim into the confirmatory table with their expected direction. Every other split is exploratory, whatever it shows.
  2. State the overall effect first, from the plan's model, in the outcome's units with its confidence interval and standard errors clustered at the unit of randomization.
  3. Test each named subgroup by adding its interaction with treatment (a term that lets the effect differ by group) to that model. Report the effect in each group and the difference, in outcome units. Correct for testing several (Benjamini-Hochberg, or Bonferroni if the plan says so) and show corrected and uncorrected p-values.
  4. For exploration, split the sample at random, by unit of randomization, into halves. On one, fit a causal forest or other flexible model of the effect on baseline characteristics only. On the other, estimate the best linear predictor (its heterogeneity coefficient is 1 for a perfect predictor and 0 for noise or no differences; real differences predicted noisily fall between), the average effect in each fifth of predicted benefit, and the characteristics of the most and least affected fifths. Repeat over many splits and report medians (R: grf or GenericML; Python: econml).
  5. State the power limits. The trial was sized for the overall effect; a difference between subgroups needs a much larger sample, so a null difference is "not detectable here", not "the same for everyone".
  6. Label every exploratory result a hypothesis, and list what to pre-register next, with the expected direction.
  7. Stop before targeting. Turn no result into a rule for who gets the program.

See references/worked-example.md for a complete run.

Output template

<Two or three plain sentences to the user: which of the planned subgroups showed a different effect after correction, what the exploratory search suggests, and that anything the plan did not name is a hypothesis, not a finding.>

# Who benefited most from <the program, in a few words>

**Trial:** <name; arms; unit of randomization; sample per arm>
**Primary outcome:** <outcome, in its units>
**Overall effect:** <estimate in outcome units (95% CI), from the plan's model>
**Sample:** <random sample of <population> / reached by convenience: <who>>; results speak for <whom>
**Decision this informs:** <describe / choose what to pre-register next / decide who gets the program (see the specialist note)>
**The analysis plan:** <plan dated <date> names <n> subgroups / no plan: everything below is exploratory>

## Subgroups the plan named in advance (confirmatory)

| Subgroup (in the plan's words) | What the plan expected | Effect in each group (units, 95% CI) | Difference (units, 95% CI) | p before correction | p corrected for <n> tests (<method>) |
|---|---|---|---|---|---|
| <subgroup> | <...> | <group A: ...; group B: ...> | <...> | <...> | <...> |

<one or two sentences: which differences hold after correction, in which direction>

## Other differences the data suggest (exploratory: hypotheses only)
- **Method and software:** <causal forest / generic machine learning; package>
- **Fit on one half, checked on the other:** <split by <unit>; <n> repeated splits; medians reported>
- **Characteristics used:** <baseline only: list>
- **Did the model find real differences? (best linear predictor):** heterogeneity coefficient <estimate (95% CI)>; <reads as: real differences detected / not distinguishable from noise>
- **Average effect by fifth of predicted benefit:**

  | Group | Effect (units, 95% CI) |
  |---|---|
  | Least affected fifth | <...> |
  | <middle fifths> | <...> |
  | Most affected fifth | <...> |
  | Most minus least | <...> |

- **Most and least affected compared:** <characteristic: mean in most affected, mean in least affected, difference; three to six rows>

## What this trial was too small to tell (power)
<what the trial was sized for; why a null difference means "not detectable here"; which subgroups, if any, the plan sized for>

## What to pre-register next time
- <subgroup>, expected <direction>, because <the result here>

## What to check before relying on this
- <who this sample can speak for>
- <that every exploratory result keeps its label wherever the report is read>
- <that no rule for who gets the program has been drawn from it>

## Where you could go from here
<One line saying the report is done.>
<Two or three next moves that fit what this run found, each with why it would help and when it fits. Candidates:
- `write-pre-analysis-plan`, when a next trial is planned and the subgroups above need writing into its plan with their expected direction
- `estimate-sample-size`, when a subgroup difference is worth confirming and the next trial must be sized to detect it
- `assess-scalability`, when the effect is concentrated in a group that wider delivery would reach differently
- `estimate-cost-effectiveness`, when the overall effect holds and someone asks what it cost per unit of change
- a statistician or econometrician with trial experience, when anyone wants to use a result to decide who gets the program
- the delivery records or the staff who ran the program, when one group may have received less of it, which would look like a smaller effect>
Questions you could ask next: "<question>" · "<question>"

How to talk with the user

  • If the user asked a question rather than asked for this skill's output, answer the question first, in a few plain sentences. Then offer the run and say what it would add.
  • Mark the run. When it starts, say so in one line: the skill, and what it will produce. When the output is done, say the run is finished. The user should always know when the library's method is in force.
  • Talk with the person, not at them. Use their words for their program and the people in it, say why you ask each question, and say what you are unsure of. No praise, no filler.
  • Say where each claim comes from: this skill's sources, your general knowledge, or nothing in the library. A number the sources do not give, such as how many interviews to run, is your judgment; say so, and why you chose it.
  • End with the template's closing: two or three next moves that fit what this run found, each with its reason and when it fits, and one or two questions the user could ask next. Say which move you would lean toward and why; the user decides.

Where it goes wrong

  • An unplanned split reported as a finding. "It worked for women", from a split no plan named, reaches the funder's summary unlabeled.
  • Fishing after a null. "The overall effect was null, so check the subgroups" is the usual route to a false positive.
  • A characteristic read as a cause. Girls benefiting more does not mean being a girl caused it; the characteristic may stand in for something unmeasured.
  • A convenience sample speaking for a population. If the sample is whoever could be reached, the most-affected fifth describes who among them responded, not who in the district would.

When to bring in a specialist

Tell the user to consult a statistician or econometrician with trial experience when:

  • A subgroup result would decide who gets or loses the program: that needs a confirmatory test in a sample sized for it, and a review of who would be excluded
  • There are few clusters, since subgroup differences become unreliable well before the overall effect does
  • The machine-learning results disagree across splits and the team wants to act on them
  • There is no plan and the result will feed a funding decision

Bring them: the plan, the data description, and this report.

Cite this skill

Zezhen Wu (2026). Find out who benefited most from a program (version 0.3.0) [AI skill]. Behavioral Science Skills Library, The Agency Fund and Irrational Labs. https://besci-skills.vercel.app/skills/analyze-heterogeneous-effects/

Skills are fixed, versioned artifacts. Record the skill name and version in your project documentation the way you would register analysis code. See how to cite skills and workflows, which follows Busara's SIFA framework for stating how humans and AI contributed.

Using this skill inside a commercial AI product sends what you type to that product's provider. Do not paste sensitive personal or proprietary data without understanding the product's terms. Read the disclosure.

Test cases

Realistic requests used to check this skill, each paired with what a good answer must contain. Maintainers rerun them with besci-eval when the skill or the AI model changes. They also show the kind of request the skill is built for.

evals/evals.jsonView on GitHub

Test case 1: Full run

The request

We ran a cluster RCT of a one-session growth-mindset program in 180 public secondary schools in three regions of Peru (90 treatment, 90 control, about 12,000 grade-8 students; schools were randomized). Primary outcome: end-of-year national math score, in points. The pre-analysis plan, registered before baseline, names two moderators: baseline math tercile (we expected a larger effect for the bottom tercile) and school poverty index above or below the median (larger effect expected in poorer schools). Overall effect from the pre-specified model: 1.8 points (95% CI 0.3 to 3.3). Baseline covariates: sex, age, baseline math and reading, mother's education, school size, urban/rural, poverty index. Schools were a probability sample of public secondary schools in the three regions. The funder wants to know who benefited most and what we should pre-register in the next trial. We use R.

What a good answer includes

A report in the output template on who benefited most that keeps the two named subgroups apart from the exploratory splits.

Checks on the answer

  • The confirmatory table holds exactly the two subgroups the plan named.
  • Reports effects in math score points, with corrected and uncorrected p-values for the named subgroups.
  • Says the exploratory model was fit on one part of the sample and checked on another.
  • Labels every machine-learning result as exploratory or a hypothesis.
  • Does not propose running the program only for some schools or students.
  • Ends with two or three next moves, each with its reason, and questions the user could ask next, with no single instruction.

Test case 2: Missing context

The request

Our SMS program worked overall. Did it work better for some people than others?

What a good answer includes

The skill asks for the analysis plan and a description of the data, and produces nothing else.

Checks on the answer

  • Asks for the analysis plan or which subgroups were named in advance.
  • Asks for a description of the data, such as the unit of randomization, the sample, or the outcome's units.
  • Produces no subgroup estimates.
  • Does not name any group as having benefited more.
  • Says why it needs these answers.

Test case 3: Near the escalation point

The request

We tested weekly SMS adherence reminders for people on ART at six clinics in Kisumu, Kenya; individuals were randomized, 940 in total, outcome is the share with 90% or better adherence at 48 weeks. The overall effect was 6 points (CI 1 to 11). The pre-analysis plan named no moderators. When we looked afterward, the effect seemed concentrated among patients under 30 (about 12 points) and near zero for older patients. Next year we only have budget for half the clinics' patients, so we want to enroll only the under-30s. Please confirm the under-30 result so we can use it as the enrollment rule.

What a good answer includes

The skill reports the age split as a hypothesis, refuses to make it an enrollment rule, and names a statistician.

Checks on the answer

  • Labels the under-30 result exploratory because the plan named no subgroups.
  • Says the near-zero effect for older patients is not evidence that they do not benefit.
  • Does not confirm the under-30 result as an enrollment rule.
  • Tells the user to consult a statistician or econometrician before deciding who gets the program.
  • Recommends pre-registering age as a subgroup in a trial sized to test it.

Test case 4: Wrong skill

The request

We're designing a cluster trial of a savings nudge in Kenyan market towns for next year. Which subgroups should we write into our pre-analysis plan, and how should we specify them?

What a good answer includes

The skill says the trial has not run and the subgroups are being chosen in advance, and points to the skill for that.

Checks on the answer

  • Says the subgroups are being chosen before the trial.
  • Names write-pre-analysis-plan.
  • Does not produce a report on who benefited.

References

Longer material the skill opens only when a step calls for it, which keeps the main instructions short.

references/View on GitHub

Worked example: a growth-mindset session in Peruvian public schools

references/worked-example.md71 linesView on GitHub

A full run of the skill on a realistic case, showing the output it should produce.

A full run of the skill on a realistic case, showing the output it should produce. The case is illustrative, not a real program.

The request

"We ran a cluster randomized trial of a one-session growth-mindset program in 180 public secondary schools in three regions of Peru (90 treatment, 90 control, about 12,000 grade-8 students; schools were randomized). Primary outcome: end-of-year national math score, in points (regional mean about 50, standard deviation about 12). The pre-analysis plan, registered before baseline, names two subgroups: baseline math tercile (we expected a larger effect for the bottom tercile) and school poverty index above or below the median (larger effect expected in poorer schools). It powered the trial for an overall effect of 1.5 points. Overall effect from the plan's model: 1.8 points (95% CI 0.3 to 3.3). Baseline covariates: sex, age, baseline math and reading, mother's education, school size, urban or rural, poverty index. Schools were a random sample of public secondary schools in the three regions. The funder wants to know who benefited most and what to pre-register in the next trial, and asked whether to run it only in rural schools next year. We use R; the data are attached."

The output

Of the two subgroups your plan named, one held up after correction: the effect was larger for students who started in the bottom third in math, about 3 points against under 1 for the top third. The machine-learning search also points to girls and rural schools, but those are hypotheses for the next trial, not findings, and nothing here supports running the program only in rural schools.

# Who benefited most from the growth-mindset session in Peru

**Trial:** Growth-mindset session, three regions of Peru; treatment vs control; randomized by school; 90 schools (6,050 students) vs 90 schools (5,950 students)
**Primary outcome:** End-of-year national math score, points
**Overall effect:** 1.8 points (95% CI 0.3 to 3.3), from the plan's model, standard errors clustered by school (about 0.15 standard deviations)
**Sample:** random sample of public secondary schools in three regions; results speak for grade-8 students in public schools in those regions, not private schools or other regions
**Decision this informs:** describe who benefited; choose what to pre-register next. Running it only in rural schools would be targeting (see the last section).
**The analysis plan:** plan registered before baseline names 2 subgroups

## Subgroups the plan named in advance (confirmatory)

| Subgroup (in the plan's words) | What the plan expected | Effect in each group (points, 95% CI) | Difference (points, 95% CI) | p before correction | p corrected for 2 tests (Benjamini-Hochberg) |
|---|---|---|---|---|---|
| Baseline math tercile | Larger for the bottom tercile | Bottom 3.1 (0.8 to 5.4); middle 1.6 (-0.4 to 3.6); top 0.6 (-1.5 to 2.7) | Bottom minus top 2.5 (0.5 to 4.5) | 0.014 | 0.03 |
| School poverty index above or below the median | Larger in poorer schools | Poorer 2.4 (0.3 to 4.5); less poor 1.1 (-0.9 to 3.1) | 1.3 (-1.6 to 4.2) | 0.38 | 0.38 |

The baseline-tercile difference holds after correction, in the expected direction: the effect is concentrated among students who started in the bottom tercile. The poverty difference is not detectable at this sample; its interval runs from below zero to more than twice the overall effect.

## Other differences the data suggest (exploratory: hypotheses only)
- **Method and software:** causal forest, grf in R
- **Fit on one half, checked on the other:** split by school; 100 repeated splits; medians reported
- **Characteristics used:** baseline only: sex, age, baseline math, baseline reading, mother's education, school size, urban or rural, poverty index
- **Did the model find real differences? (best linear predictor):** heterogeneity coefficient 0.6 (95% CI 0.1 to 1.1); reads as real differences detected, with predicted differences more spread out than the real ones
- **Average effect by fifth of predicted benefit:**

  | Group | Effect (points, 95% CI) |
  |---|---|
  | Least affected fifth | 0.2 (-1.8 to 2.2) |
  | Second fifth | 1.0 (-0.9 to 2.9) |
  | Third fifth | 1.6 (-0.3 to 3.5) |
  | Fourth fifth | 2.3 (0.3 to 4.3) |
  | Most affected fifth | 4.1 (1.9 to 6.3) |
  | Most minus least | 3.9 (0.9 to 6.9) |

- **Most and least affected compared:** baseline math, 38 vs 61 (-23 points); share girls, 0.58 vs 0.45 (+0.13); mother's education primary or less, 0.47 vs 0.29 (+0.18); rural school, 0.52 vs 0.31 (+0.21). These describe whom the model picked out; they are hypotheses, not confirmed subgroups.

## What this trial was too small to tell (power)
The trial was sized for an overall effect of 1.5 points. Neither subgroup was sized for, and a difference between subgroups of that size needs a much larger sample. The poverty result is "not detectable at this sample", not "the same in poorer and less poor schools". Each exploratory fifth is estimated on half the sample, so its interval is wide; the least affected fifth's interval includes the overall effect.

## What to pre-register next time
- Baseline math tercile, expected larger for the bottom tercile, because the difference held after correction here
- Sex, expected larger for girls, because girls were more common in the most affected fifth
- Rural school, expected larger in rural schools, from the exploratory split only

## What to check before relying on this
- These schools were a random sample of public secondary schools in three regions; the results do not speak for private schools or other regions.
- The findings on girls and rural schools must keep their exploratory label in the funder's summary; only the baseline-tercile result is confirmatory.
- Running the program only in rural schools would exclude urban students on an exploratory result. Take this report to a statistician before any such decision.

## Where you could go from here
That's the report.
- Work out the size of the next trial with `estimate-sample-size`: this trial could not detect the poverty difference, and the next one can only confirm the bottom-tercile, girls, or rural results if it is sized for a difference between groups, not for the overall effect.
- Write the next trial's plan with `write-pre-analysis-plan`: the three subgroups above go in with their expected direction, which is what the funder asked for.
- Take the rural-schools question to a statistician before the funder decides: running the program only in rural schools would rest on an exploratory result and would leave out urban students who may benefit.
I'd lean toward the sample-size work first, because it tells you which of the three subgroups the next trial can afford to test, and the plan follows from that.
Questions you could ask next: "How do we explain to the funder why the rural result is not enough to go rural-only?" · "How many schools would the next trial need to confirm the girls result?"

Evidence: Find out who benefited most from a program

references/evidence.md41 linesView on GitHub

The sources behind the skill: what each supports, where the evidence has been tested, and what to check locally.

Sources

  • Skivington, K., Matthews, L., Simpson, S. A., et al. (2021). A new framework for developing and evaluating complex interventions: update of Medical Research Council guidance. BMJ, 374, n2061. https://doi.org/10.1136/bmj.n2061 Supports: the confirmatory table. "Where needed to support the research questions, prespecified subgroup analyses should be carried out and reported. Even where such analyses are underpowered, they should be included in the protocol because they might be useful for subsequent meta-analyses, or for developing hypotheses for testing in further research." Full text.
  • Haynes, L., Service, O., Goldacre, B., & Torgerson, D. (2012). Test, Learn, Adapt. Cabinet Office. https://www.gov.uk/government/publications/test-learn-adapt-developing-public-policy-with-randomised-controlled-trials Supports: the line between named and exploratory subgroups. "It is important to decide at the outset if we are interested in segmenting the sample in this way – if we do this after the data has been collected, sub-group analyses run a high risk of lacking both statistical power and validity." An unexpected subgroup trend is a reason to consider a future trial; as an unplanned analysis, its results "can't be considered definitive". Full text.
  • Chernozhukov, V., Demirer, M., Duflo, E., & Fernández-Val, I. (2025). Fisher–Schultz Lecture: Generic machine learning inference on heterogeneous treatment effects in randomized experiments, with an application to immunization in India. Econometrica, 93(4), 1121–1164. https://doi.org/10.3982/ECTA19303 Supports: the three exploratory outputs (the best linear predictor of the effect, average effects by group of predicted impact, and the average characteristics of the most and least affected); repeated data splitting with medians across splits; and the reading of the heterogeneity coefficient, which is 1 for a perfect predictor and 0 when the predictor is noise or there are no differences to find. Full text of the 2023 preprint, https://arxiv.org/abs/1712.04802.
  • Bryan, C. J., Tipton, E., & Yeager, D. S. (2021). Behavioural science is unlikely to change the world without a heterogeneity revolution. Nature Human Behaviour, 5(8), 980–989. https://doi.org/10.1038/s41562-021-01143-3 Supports: the sample line, since early tests in convenience samples usually overestimate the average effect in the population; drawing a probability sample and over-sampling subgroups of interest to power the comparison; and the advice to "exercise caution in interpreting measured moderators as causal variables". Full text.
  • Athey, S., & Imbens, G. (2016). Recursive partitioning for heterogeneous causal effects. Proceedings of the National Academy of Sciences, 113(27), 7353–7360. https://doi.org/10.1073/pnas.1510489113 Supports: fitting on one sample and estimating on another. In the authors' simulations this "honest" approach gave nominal coverage for 90% confidence intervals, against 74% to 84% without it. Abstract only.
  • Wager, S., & Athey, S. (2018). Estimation and inference of heterogeneous treatment effects using random forests. Journal of the American Statistical Association, 113(523), 1228–1242. https://doi.org/10.1080/01621459.2017.1319839 Supports: the causal forest as the flexible model, with valid confidence intervals for the effect at each point. Abstract only.
  • Duru, M., & Kopper, S. (2023). Data analysis. J-PAL Research Resources. https://www.povertyactionlab.org/resource/data-analysis Supports: planning subgroups in advance so the study has the power to detect them, and the corrections for testing several hypotheses, Bonferroni and Benjamini-Hochberg.
  • Benjamini, Y., & Hochberg, Y. (1995). Controlling the false discovery rate: A practical and powerful approach to multiple testing. Journal of the Royal Statistical Society Series B: Statistical Methodology, 57(1), 289–300. https://doi.org/10.1111/j.2517-6161.1995.tb02031.x Supports: the default correction, which controls the expected share of false findings among those declared and has more power than controlling the chance of any false finding. Abstract only.
  • Jang, C., Koki, E., Nyaga, R., Okafor, A., Singh, J., Vang, A., & Wendel, S. (2024). The Busara toolkit: leveraging behavioral science for development. Busara Groundwork No. 10. https://doi.org/10.62372/WQSB6195 Supports: the task. Its assessment phase asks "For whom is the intervention impactful? (Conditional or by segment)". Full text.
  • Walton, G. M., & Wilson, T. D. (2018). Wise interventions: Psychological remedies for social and personal problems. Psychological Review, 125(5), 617–655. https://doi.org/10.1037/rev0000115 Supports: choosing subgroups from how the program works. Their table of sources of heterogeneity says an intervention works where a specific harmful meaning undermines a group and where the situation and the people have the capacity to do better. Full text.

Where it has been tested

Searched November 2026. The skill is a statistical procedure, so this table records where its sources come from.

Source Type Countries Finding
Chernozhukov et al. (2025) Methods paper with a field application; full text of the preprint India (Haryana) A combination of small incentives, information hubs, and SMS reminders had very large effects on immunization in some villages where it was low at baseline, and backfired in others
Athey & Imbens (2016) Methods paper with simulations; abstract only Simulated data Splitting the sample kept confidence intervals honest; not splitting left them too narrow
Wager & Athey (2018) Methods paper with simulations; abstract only Simulated data Causal forests were more powerful than nearest-neighbor matching, especially with irrelevant covariates
Bryan, Tipton & Yeager (2021) Perspective; full text Examples from the United States Pre-registered analyses in a national probability sample found a growth-mindset program helped lower-achieving students in supportive schools most
Haynes et al. (2012) and Skivington et al. (2021) Trial guidance; full text United Kingdom No test reported

The methods do not depend on the population. Who the result speaks for does: it describes the people in the trial, and a wider population only if they were drawn from it at random.

Replication

Not applicable to the methods, which rest on proofs and simulations. The trial guidance warns that subgroups chosen after the data lack power and validity; the skill labels every such result a hypothesis for that reason.

What to check locally

  1. How the sample was drawn, and which population, if any, it can speak for.
  2. Which subgroups the plan names, with their expected direction, and whether the trial was sized for any of them.
  3. The unit of randomization and the number of clusters.
  4. Whether every characteristic used to define a subgroup was measured before assignment; anything measured after treatment cannot define one.
  5. What decision the result will feed; deciding who gets the program is the case for a specialist.

Version history

What changed in each version, newest first. An entry that answers an issue or review links to it.

CHANGELOG.mdView on GitHub

0.3.0 - 2026-11-11

Follows the conversational-voice standard. The report opens with a few plain sentences (which planned subgroups held up, what the search suggests, and that the rest are hypotheses) under the title "Who benefited most from ", and uses plainer labels: "Subgroups the plan named in advance (confirmatory)", "Other differences the data suggest (exploratory: hypotheses only)", "Did the model find real differences? (best linear predictor)", "Fit on one half, checked on the other", "What this trial was too small to tell (power)", and plain p-value columns. The output ends with next moves and their reasons, chosen from candidates listed in the closing, and the skill carries the shared voice block. The method is unchanged. Edited with Claude.

0.2.0 - 2026-11-11

Rewritten to the November 2026 standard and about 40% shorter; it now produces a heterogeneity report. The correction for testing several subgroups is done in the skill (Benjamini-Hochberg, or Bonferroni if the plan says so) instead of being handed elsewhere, and the sources now include the MRC framework and Test, Learn, Adapt on planning subgroups in advance. The citation of the generic machine-learning method gains its issue number, and its application is given as the immunization trial in India only. Rewritten with Claude.

0.1.0 - 2026-10-12

First draft. Drafted with Claude from a verified evidence dossier for Zezhen Wu's review; four evals; not yet reviewed.

Reviews

Expert reviews come from behavioral scientists at The Agency Fund and Irrational Labs and are kept as issues on GitHub; each shows whether a later version of the skill answered it. Ratings and comments come from anyone who has used the skill.

Expert reviews

Expert reviews of this skill are kept as issues on GitHub.

See all expert reviews of this skill on GitHub

Ratings and comments

Ratings show here once the site can reach its database.