Agent skill · Data & Analytics

bio-clinical-biostatistics-subgroup-analysis

Performs subgroup and heterogeneous treatment effect (HTE) analyses for clinical trials. Covers Mantel-Haenszel pooling, Breslow-Day, interaction tests in regression, RERI for additive interaction, modern data-adaptive HTE methods (STEPP, SIDES, causal forests, X/R-learners), Bayesian shrinkage (Dixon-Simon, MAP, EXNEX), graphical multiplicity (Bretz-Maurer), and credibility frameworks (Sun BMJ, EMA 2019). Use when analyzing treatment effects across patient subgroups for regulatory submissions or precision-medicine claims.

BioTender-maxgithub.com/BioTender-maxGitHub ↗
claude-codeships scriptsNOASSERTION
Install
npx skills add BioTender-max/awesome-bio-agent-skills --skill subgroup-analysis --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 3
SKILL.md size: 34 KB
Bundled scripts: yes
Path: skills/bioskills/subgroup-analysis/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 135
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

Review
written from the skill's own SKILL.md · Aug 5, 2026

What it does

Performs subgroup and heterogeneous treatment effect (HTE) analyses for clinical trials, covering Mantel-Haenszel pooling, Breslow-Day, interaction tests in regression, RERI for additive interaction, modern data-adaptive HTE methods (STEPP, SIDES, causal forests, X/R-learners), Bayesian shrinkage (Dixon-Simon, MAP, EXNEX), graphical multiplicity (Bretz-Maurer), and credibility frameworks (Sun BMJ, EMA 2019). Use when analyzing treatment effects across patient subgroups for regulatory submissions or precision-medicine claims.

How it works

The skill explicitly instructs step-by-step methods and examples:

  • Mantel-Haenszel pooled odds ratio calculation across strata with CMH test; Breslow-Day test for homogeneity; cautions on power and interpretation. Includes Python snippet using StratifiedTable to compute pooled OR, confidence interval, and p-values for CMH and Breslow-Day.
  • Interaction terms in a single regression model as the regulatory standard; provides code for logistic regression with interaction, LR test against an additive model, and extraction of subgroup-specific ORs with confidence intervals.
  • RERI for additive interaction, describing the computation and interpretation in terms of ORs and the delta-method/bootstrap for CIs.
  • Modern data-adaptive HTE methods: STEPP, SIDES/SIDEScreen, causal forests, Meta-learners (X/R-learner, MOB). It shows conceptual workflows and references, with Python/R code hints:
    • STEPP: sliding-window approach with permutation supremum tests; notes on correlation of estimates and Naive CI limitations.
    • SIDES/SIDEScreen: recursive partitioning with permutation-adjusted subgroup p-values; multiplicity absorption.
    • Causal forests: use grf in R or econml in Python; emphasis on honest splitting, ATE/CATE estimation, and calibration testing (test_calibration).
    • Meta-learners: S-, T-, X-, and R-learners with cross-fitting and propensity considerations; example code using econml XLearner or related classes.
  • Bayesian shrinkage: describes Dixon-Simon 1991 prior for exchangeable interaction effects, EXNEX approach, and notes on borrowing across baskets with caution about prior influence.
  • Diagnostic and regulatory context: references to credibility frameworks (Sun BMJ, EMA 2019) and considerations for pre-specified vs discovery subgroups, multiplicity adjustments, and reporting practices.

When to use it

Use when: analyzing treatment effects across subgroups, including regulatory submissions or precision-medicine claims; when planning subgroup analyses with pre-specified or data-discovered subgroups; when employing either classical stratified methods or modern HTE approaches and Bayesian borrowing.

What it can touch

Tooling is restricted to the primary tool: statsmodels for Python-based analyses and R packages (STEPP, SIDES, grf) as indicated; executable scripts ship with the skill folder and are meant for Python usage with statsmodels and related libraries as stated.

Caveats

Notes include power limitations for interaction detection, potential over- or under-estimation in heterogeneity, need to declare confirmatory vs exploratory intent, and sensitivity to prior choices in Bayesian shrinkage; also cautions about honest-splitting validation and calibration checks in causal forests. Licensing is NOASSERTION.

From the SKILL.md

## Version Compatibility Reference examples tested with: statsmodels 0.14+, scipy 1.12+, numpy 1.26+, pandas 2.1+, matplotlib 3.8+, scikit-learn 1.4+. R packages cited: grf, policytree, causalToolbox, personalized, SIDES, stepp, gMCP, partykit, RBesT, brms. Before using code patterns, verify installed versions match. If versions differ: - Python: `pip show <package>` then `help(module.function)` to check signatures - R: `packageVersion('<pkg>')` then `?function_name` If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying. # Subgroup Analysis and Heterogeneous Treatment Effects **"Analyze treatment effects across subgroups"** -> Test whether treatment effects differ across pre-specified or data-discovered subgroups using interaction tests, stratified estimators, modern data-adaptive HTE methods, or Bayesian shrinkage -- with explicit declaration of confirmatory vs exploratory intent and credibility assessment. ## The Senn Foundation -- Why Most Subgroup Claims Are Wrong **Senn 2018 *Nature* 563:619-621 (and *Statistical Issues in Drug Development* Ch. 9, 14):** observed between-pat

What's inside
Steps it walks through
  1. Version Compatibility
  2. The Senn Foundation -- Why Most Subgroup Claims Are Wrong
  3. Algorithmic Taxonomy
  4. Decision Tree by Scenario
  5. Mantel-Haenszel and Stratified Analysis
  6. Interaction Terms in Regression -- The Correct Way
  7. RERI for Additive Interaction
  8. Modern Data-Adaptive HTE Methods
  9. STEPP (Subpopulation Treatment Effect Pattern Plot)
  10. SIDES / SIDEScreen
  11. Causal forests (Athey-Wager)
  12. Meta-learners (Künzel-Sekhon-Bickel-Yu 2019 PNAS 116:4156)
  13. Bayesian Shrinkage -- The Postdoc Argument
  14. Multiplicity for Subgroup Analyses
Ships with 2 files
  • examples/subgroup_analysis_clinical.py
  • usage-guide.md
More from awesome-bio-agent-skills
All skills →
About this skill
What does the bio-clinical-biostatistics-subgroup-analysis skill do?

Performs subgroup and heterogeneous treatment effect (HTE) analyses for clinical trials. Covers Mantel-Haenszel pooling, Breslow-Day, interaction tests in regression, RERI for additive interaction, modern data-adaptive HTE methods (STEPP, SIDES, causal forests, X/R-learners), Bayesian shrinkage (Dixon-Simon, MAP, EXNEX), graphical multiplicity (Bretz-Maurer), and credibility frameworks (Sun BMJ, EMA 2019). Use when analyzing treatment effects across patient subgroups for regulatory submissions or precision-medicine claims.

How do I install it?

Run `npx skills add BioTender-max/awesome-bio-agent-skills --skill subgroup-analysis --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From BioTender-max/awesome-bio-agent-skills, a repository with 135 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going