[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EBYJBJKTWH6RB5XQVHCAJT":3,"skill-same:01M7EBYJBJKTWH6RB5XQVHCAJT":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":14,"repositoryHtmlUrl":33,"repositoryHomepageUrl":33,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M7EBYJBJKTWH6RB5XQVHCAJT","bio-clinical-biostatistics-subgroup-analysis",null,"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\u002FR-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.","Mr-Nobody-Anonymous\u002FAll-skills","Mr-Nobody-Anonymous","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184253119?v=4","01M7AEXFJHKTYQW5R0ZCQQTWFV","anonymous","01M7C00M3GQR4QKP9GZA42GFAK",0,"MIT","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-clinical-biostatistics-subgroup-analysis\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bio-clinical-biostatistics-subgroup-analysis\ndescription: 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\u002FR-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.\ntool_type: python\nprimary_tool: statsmodels\nsource: \"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills\"\nsource_repository: \"GPTomics\u002FbioSkills\"\nsource_path: \"clinical-biostatistics\u002Fsubgroup-analysis\u002FSKILL.md\"\nlicense: \"MIT\"\nimported_at: \"2026-09-20\"\n---\n\n## Version Compatibility\n\nReference 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.\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- Python: `pip show \u003Cpackage>` then `help(module.function)` to check signatures\n- R: `packageVersion('\u003Cpkg>')` then `?function_name`\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.\n\n# Subgroup Analysis and Heterogeneous Treatment Effects\n\n**\"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.\n\n## The Senn Foundation -- Why Most Subgroup Claims Are Wrong\n\n**Senn 2018 *Nature* 563:619-621 (and *Statistical Issues in Drug Development* Ch. 9, 14):** observed between-patient response variation is NOT evidence of patient-level HTE. It conflates within-patient noise, period effects, regression-to-the-mean, and measurement error with true individual heterogeneity. Senn-Rolfe-Julious 2011 *SMMR* 20:657 documents that variance-component decomposition of replicate-crossover trials repeatedly fails to find subject-by-treatment interaction even where reviewers were certain one must exist.\n\n**Brookes et al 2004 *J Clin Epidemiol* 57:229 — the 4x penalty:** detecting a treatment-by-subgroup interaction requires approximately 4x the sample size needed to detect the main treatment effect of similar magnitude. A trial powered to detect OR=0.6 overall cannot reliably detect subgroup differences of similar magnitude. Non-significant interaction tests are usually underpowered, not null.\n\n**Senn's aphorism (paraphrased from SIDD):** \"a trial can have subgroup analyses or proper power, not both.\" A single trial cannot simultaneously be powered for a primary effect AND for credible subgroup discovery; pretending otherwise misrepresents posterior uncertainty.\n\n## Algorithmic Taxonomy\n\n| Method | What it answers | Inference | Strength | Fails when |\n|--------|-----------------|-----------|----------|------------|\n| Mantel-Haenszel \u002F CMH | Common OR across pre-defined strata | Asymptotic | Preserves stratification factor from randomisation | Stratum ORs reverse direction (Simpson) |\n| Breslow-Day | Homogeneity of stratum ORs | Asymptotic chi-square | Test of effect modification | Underpowered with few\u002Fsparse strata; non-significance NOT proof of homogeneity |\n| Gail-Simon 1985 | **Qualitative** interaction (sign reversal) | Likelihood ratio | Distinguishes quantitative from qualitative | Original LR is liberal at small n; use exact critical values (Pan-Wolfe 1997) |\n| Logistic regression interaction | Per-subgroup conditional OR | Wald, LR | Most efficient single-model approach | Conditional ORs subject to non-collapsibility; over-fits in multi-way |\n| RERI | Additive interaction on multiplicative scale | Delta-method or bootstrap CI | Captures public-health-relevant scale | Delta-method poor near boundary; nonlinear function of three ORs |\n| STEPP (Bonetti-Gelber 2000) | Continuous covariate subgroups via overlapping windows | Permutation supremum test | Avoids dichotomisation of biomarkers | Window-size choice affects results; correlated estimates require permutation inference |\n| SIDES \u002F SIDEScreen (Lipkovich 2011) | Data-discovered subgroups via recursive partitioning | Resampling-adjusted base-vs-complement p | Multiplicity correctly absorbed | Tuning skeleton parameters affects FWER calibration |\n| QUINT (Dusseldorp 2014) | Qualitative-interaction trees | Bootstrap stability | Directly tests crossover (A-better, B-better, equal) | Only two-arm continuous\u002Fbinary; survival extensions ad hoc |\n| Virtual Twins (Foster 2011) | Per-subject CATE via twin RF predictions | Bootstrap | Decouples nuisance from interpretable subgroup | Biased when RF underestimates effect heterogeneity in either arm |\n| Causal forests (Athey-Wager 2019) | Pointwise CATE with honest splits | Influence-function CI | Asymptotic Gaussianity; doubly robust via AIPW | Finite-sample CI validity at trial-scale n debated (Rehill 2025) |\n| Meta-learners X\u002FR-learner (Künzel 2019) | Marginal\u002Fconditional CATE | Cross-fit influence function | X-learner dominates T-learner when arms unbalanced | Needs propensity for X-learner; R-learner requires nuisance n^(1\u002F4) rate |\n| MOB (Zeileis 2008) | Parameter-instability trees | M-fluctuation test | Theoretically clean; invariant to monotone transforms | Worse out-of-sample CATE than causal forest at large p |\n| Bayesian shrinkage (Dixon-Simon 1991) | Posterior subgroup effects shrunken to overall | Posterior intervals from MCMC | Honest about prior expectation of no qualitative interaction | Prior choice on tau drives results; Dane et al 2019 white paper warns against for signal generation |\n| EXNEX (Neuenschwander 2016) | Mixture of exchangeable + per-basket non-exchangeable | Posterior | Avoids HM \"catastrophic borrowing\" when one basket truly different | Weight choice (often 0.5\u002F0.5 default) affects borrowing strength |\n\n**Postdoc reading list:**\n\n- Wang et al 2007 *NEJM* 357:2189 (\"Reporting of subgroup analyses in clinical trials\") — the canonical NEJM-mandated practice\n- Sun et al 2010\u002F2012 *BMJ* 340:c117 and 344:e1553 — 11 credibility criteria\n- Dane, Spencer, Rosenkranz, Lipkovich, Parke 2019 *Pharm Stat* 18:126 with Hemmings-Koch commentary at 18:140 — EFSPI white paper + critique\n- EMA 2019 Guideline on subgroups (EMA\u002FCHMP\u002F539146\u002F2013, effective Aug 2019) — distinguishes \"assessment subgroups\" (regulatory, pre-specified) from \"discovery subgroups\" (exploratory)\n- Athey & Wager 2019 *Observational Studies* 5:37; Athey, Tibshirani, Wager 2019 *Ann Stat* 47:1148 — causal forests\n- Rehill 2025 *Int Stat Rev* — applied causal forest audit; many papers misreport tuning and omit honest-splitting\u002Fcalibration diagnostics\n\n## Decision Tree by Scenario\n\n| Scenario | Recommended approach | Why |\n|----------|----------------------|-----|\n| Pre-specified subgroup in confirmatory trial | Interaction term in single model + graphical-procedure multiplicity (gMCP) | EMA 2019 \"assessment subgroup\"; interaction test + Bonferroni-graph alpha control |\n| Stratified randomisation by site\u002Fregion | CMH or logistic with strata as covariates; stratum-specific OR reported in forest plot | Kahan-Morris 2012; ignoring strata is over-conservative (SE biased upward, power loss); strata-specific ORs for transparency |\n| 5-15 pre-specified subgroups, regulatory submission | Forest plot + interaction tests + Holm\u002Fgraphical FWER correction | Default regulatory presentation; multiplicity adjustment expected |\n| Continuous biomarker subgroup (e.g., HbA1c, biomarker score) | STEPP (sliding-window plot + permutation supremum test) | Avoids arbitrary dichotomisation; cite Bonetti-Gelber 2004 |\n| Suspected qualitative interaction (treatment helps some, harms others) | Gail-Simon 1985 LR test with Pan-Wolfe 1997 exact critical values | Distinguishes quantitative from qualitative; critical for label restriction |\n| Data-discovery of HTE subgroup | SIDES\u002FSIDEScreen with permutation FWER + replication mandate | Lipkovich 2011; signal-discovery not signal-confirmation |\n| Continuous CATE estimation with many covariates | Causal forest (R `grf::causal_forest`) + RATE test (Yadlowsky 2025) | Modern HTE; honest splitting; influence-function CIs; RATE tests whether ranking is predictive vs prognostic |\n| Basket trial across rare-disease strata | EXNEX or robust MAP with `RBesT` | Borrows across strata while permitting one to detach if truly different |\n| Subgroup signal needing replication planning | Bayesian shrinkage for adjusted estimates; Sun 2012 winner's curse | Selected subgroups have inflated effect by selection bias |\n| Pediatric extrapolation borrowing from adult data | Power prior (gamma in 0.3-0.6) per FDA Bayesian draft Jan 2026 | Partial borrowing with discount; standard regulatory approach |\n\n## Mantel-Haenszel and Stratified Analysis\n\n**Goal:** Estimate a pooled treatment effect across strata while testing homogeneity.\n\n**Approach:** Construct per-stratum 2x2 tables; CMH for pooled OR and null test; Breslow-Day for homogeneity (with caveats).\n\n```python\nfrom statsmodels.stats.contingency_tables import StratifiedTable\nimport pandas as pd\nimport numpy as np\n\ntables = []\nfor stratum in df['site'].unique():\n    sub = df[df['site'] == stratum]\n    t = pd.crosstab(sub['treatment'], sub['outcome']).values\n    if t.shape == (2, 2) and t.min() > 0:\n        tables.append(t)\n\nst = StratifiedTable(tables)\nprint('MH pooled OR:', st.oddsratio_pooled)\nprint('95% CI:', st.oddsratio_pooled_confint())\nprint('CMH H0: common OR=1, p =', st.test_null_odds().pvalue)\nprint('Breslow-Day H0: equal ORs, p =', st.test_equal_odds().pvalue)\n```\n\n**Breslow-Day power trap:** with k=3 strata and modest heterogeneity, Breslow-Day power can be \u003C40%. Non-significance does NOT prove homogeneity — it just means the null cannot be rejected. Always supplement with a forest plot AND an LR interaction test from logistic regression.\n\n## Interaction Terms in Regression -- The Correct Way\n\n**Single model with interaction is the regulatory standard** — comparing p-values from separate per-subgroup models is statistically invalid (separate models have different power, and the p-value differences confound effect size with sample size).\n\n```python\nimport statsmodels.formula.api as smf\nimport numpy as np\n\n# Single model with interaction (CORRECT)\nmodel = smf.logit(\n    'outcome ~ C(treatment, Treatment(reference=\"Placebo\")) * C(age_group)',\n    data=df\n).fit()\n# Interaction coefficient tests effect modification\n# LR test: compare to additive model:\nadditive = smf.logit('outcome ~ C(treatment, Treatment(reference=\"Placebo\")) + C(age_group)', data=df).fit()\nlr_p = 1 - chi2.cdf(2 * (model.llf - additive.llf), model.df_model - additive.df_model)\n\n# Extract subgroup-specific ORs for reporting:\nfor group in df['age_group'].unique():\n    sub_model = smf.logit('outcome ~ C(treatment, Treatment(reference=\"Placebo\"))',\n                          data=df[df['age_group'] == group]).fit()\n    or_val = np.exp(sub_model.params.iloc[1])\n    ci = np.exp(sub_model.conf_int().iloc[1])\n    print(f'{group}: OR={or_val:.3f} ({ci[0]:.3f}-{ci[1]:.3f})')\n```\n\n## RERI for Additive Interaction\n\n```python\n# Fit interaction model: outcome ~ treatment + subgroup_indicator + treatment:subgroup_indicator\n# OR_11 = OR for treated in subgroup (vs untreated not in subgroup)\n# OR_10 = OR for treated not in subgroup\n# OR_01 = OR for untreated in subgroup\nreri = or_11 - or_10 - or_01 + 1\n# RERI > 0 = synergism (combined effect > sum of individual)\n# RERI = 0 = no additive interaction\n# RERI \u003C 0 = antagonism\n# CI requires delta method or bootstrap (nonlinear function of three ORs)\n```\n\n**Multiplicative vs additive interaction:** logistic regression tests multiplicative interaction (ratio of ORs). Null multiplicative interaction does NOT imply null additive interaction. For public health decisions, additive interaction is often more relevant.\n\n## Modern Data-Adaptive HTE Methods\n\n### STEPP (Subpopulation Treatment Effect Pattern Plot)\n\n```python\n# R recommended; Python equivalents are emerging\n# library(stepp)\n# subset_obj \u003C- new('stwin', type='sliding', r1=100, r2=200)  # window sizes\n# step_obj \u003C- stepp(eff='binary', cov='biomarker', trt='treatment',\n#                   resp='outcome', subset=subset_obj, ...)\n# plot(step_obj); test_pattern(step_obj, nperm=1000)\n```\n\nBonetti-Gelber 2000\u002F2004; window-size choice (sliding vs tail-oriented) affects results. **Naive simultaneous CIs are wrong** — estimates are correlated across windows; use permutation-based supremum tests of pattern flatness (Yip et al 2016 *Clin Trials* 13(4):382; tail-oriented STEPP is more stable than the sliding-window variant).\n\n### SIDES \u002F SIDEScreen\n\n```python\n# R: library(SIDES) or library(rsides)\n# Recursive partitioning with differential-effect splitting + permutation-adjusted subgroup p\n```\n\nLipkovich-Dmitrienko-Denne-Enas 2011 *Stat Med* 30:2601; SIDEScreen (Lipkovich-Dmitrienko 2014 *J Biopharm Stat* 24:130) adds variable-importance prefilter + base-vs-complement test. **The inferential complement test correctly absorbs multiplicity of considered splits** — Bonferroni alternatives over-correct.\n\n### Causal forests (Athey-Wager)\n\n```python\n# R recommended; econml is the Python equivalent\n# library(grf)\n# cf \u003C- causal_forest(X, Y, W, num.trees=2000)\n# tau.hat \u003C- predict(cf, X)$predictions\n# test_calibration(cf)  # omnibus calibration test\n```\n\n**Honest splitting** (one sub-sample for splits, another for leaf estimates) yields asymptotic Gaussianity and pointwise CIs (Athey-Tibshirani-Wager 2019 *Ann Stat* 47:1148). Doubly-robust variants use AIPW pseudo-outcomes.\n\n**Diagnostic discipline (Rehill 2025 audit):** applied causal-forest papers frequently misreport tuning, skip honest-splitting validation, or omit the `test_calibration` check. Required diagnostic steps:\n\n1. Honest splitting enabled (`honesty=TRUE`)\n2. `test_calibration(cf)` — regresses actual treatment effects on out-of-bag CATE predictions; significant positive slope = CATE has signal\n3. Variable importance via permutation\n4. RATE\u002FAUTOC test (Yadlowsky 2025 *JASA*) — single p-value omnibus test for whether CATE ranking has predictive (not just prognostic) value\n\n### Meta-learners (Künzel-Sekhon-Bickel-Yu 2019 *PNAS* 116:4156)\n\n- **S-learner:** single outcome model on (Z, X); take difference. Biased when treatment effect smaller than baseline effect.\n- **T-learner:** separate models per arm; take difference. Standard baseline.\n- **X-learner:** T-learner + cross-imputation + propensity weighting. Dominates T-learner when arms unbalanced (1:k, k>=3) or true CATE is smoother than response.\n- **R-learner (Nie-Wager 2021 *Biometrika* 108:299):** orthogonal Robinson-style residualisation, debiased ML. Asymptotically dominates X-learner when nuisance models converge at n^(1\u002F4) rate.\n\n```python\n# Python: econml\nfrom econml.dml import CausalForestDML, LinearDML\nfrom econml.metalearners import XLearner, TLearner\n# Or: from causalml.inference.meta import LRSRegressor, XGBTRegressor\n\nxl = XLearner(models=GradientBoostingRegressor(), propensity_model=LogisticRegression())\nxl.fit(Y, T=W, X=X)\ncate = xl.effect(X)\n```\n\n## Bayesian Shrinkage -- The Postdoc Argument\n\n**Dixon-Simon 1991 *Biometrics* 47:871:** exchangeable mean-zero prior on treatment-by-subgroup interaction coefficients; subgroup posteriors shrink to overall trial effect, proportional to evidence of heterogeneity. Honest about prior expectation that no qualitative interaction will hold.\n\n**Berry, Broglio, Groshen, Berry 2013 *Clin Trials* 10:720 (NOT JCO — common citation error):** hierarchical pooling across baskets calibrated by between-basket variance tau-squared. Inflated false-positives when tau-squared mis-specified (Freidlin-Korn 2013 *Clin Cancer Res* 19:1326 critique).\n\n**EXNEX (Neuenschwander, Wandel, Roychoudhury, Bailey 2016 *Pharm Stat* 15:123):** mixture of exchangeable (shared mean+variance) + non-exchangeable (per-basket independent) components, typically weighted 0.5\u002F0.5. Avoids HM catastrophic borrowing when one basket truly different. Now near-standard in oncology basket trials.\n\n**MAP priors (Schmidli et al 2014 *Biometrics* 70:1023):** meta-analytic-predictive prior. Fit random-effects meta-analysis of historical control arms, derive predictive distribution for new control arm, use as informative prior. Effective sample size from history typically 20-80% of new control arm. **Robust MAP** adds vague mixture component (weight 0.1-0.3) to guard against prior-data conflict. R `RBesT` is the canonical CRAN tool (Weber et al 2021 *J Stat Softw* 100:19).\n\n**The Dane vs Hemmings argument:**\n\n- Dane et al 2019 *Pharm Stat* 18:126 (EFSPI white paper): propose a standardised-effect benchmark in the neighbourhood of ~0.5σ for \"noteworthy heterogeneity\" (verify the exact figure against the white paper before quoting); tiered structure (key\u002Fimportant\u002Fexploratory); signal-vs-noise diagnostics.\n- Hemmings & Koch 2019 *Pharm Stat* 18:140 commentary: **explicitly REJECT Bayesian shrinkage for signal generation** because \"Bayesian shrinkage assumes treatment effects are consistent\" and pre-emptively damps the very heterogeneity one is searching for. Shrinkage is endorsed only for *post-signal replication planning*.\n\n**What postdocs argue about:** whether shrinkage is appropriate at the signal-generation stage; the prior on tau drives everything (Senn-style: tau ~ HalfNormal(0, 0.1); regulatory-tolerant: tau ~ HalfNormal(0, 0.5)).\n\n## Multiplicity for Subgroup Analyses\n\n**Bonferroni is rarely right** for subgroup tests because they are heavily positively correlated (same outcome, overlapping samples). Bonferroni assumes worst-case dependence; loses 30-50% power vs Hommel\u002Fresampling for ~10 demographic subgroups.\n\n**Graphical procedures (Bretz-Maurer-Hommel)** — see clinical-biostatistics\u002Fmultiplicity-graphical for full treatment. The graph for a typical subgroup analysis SAP:\n\n- Primary endpoint at full alpha\n- Alpha propagates to \"key secondary\" endpoints if primary rejects\n- Alpha propagates to pre-specified subgroup interaction tests if primary rejects\n- Discovery subgroups at most receive a small alpha slice (Dane et al recommend \u003C=20%)\n\n```python\n# R: library(gMCP); graphView(graphMCP(...))  # interactive or programmatic\n```\n\n**Goeman, Hemerik, Solari 2021 *Ann Stat* 49:1218:** \"only closed testing procedures are admissible for controlling FDP\u002FFWER\u002Fk-FWER\" — graphical, gatekeeping, Hommel, fallback are all closed tests in disguise. The graph IS the procedure.\n\n## Pre-Specified vs Post-Hoc and EMA 2019\n\n| Aspect | Pre-specified (\"assessment\") | Post-hoc (\"discovery\") |\n|--------|------------------------------|------------------------|\n| Timing | Before unblinding, in SAP | After seeing data |\n| Credibility | High if biologically justified | Low; hypothesis-generating only |\n| Regulatory weight per EMA 2019 | Can support labeling claims | Cannot support claims alone |\n| Multiplicity adjustment | Required per SAP (graphical or Holm) | Required + heavy skepticism |\n| Number expected | Few (5-15); pre-justified | Unlimited but unblindable |\n\n**EMA 2019 Guideline on Investigation of Subgroups in Confirmatory Trials (EMA\u002FCHMP\u002F539146\u002F2013, effective Aug 2019)** position: interaction tests alone are \"neither necessary nor sufficient\"; consistency is a holistic judgment; subgroup-specific licensing requires pre-specified evidence of differential effect PLUS biological rationale.\n\n**Sun BMJ 2012 11 credibility criteria** (the canonical academic framework):\n\n1. Covariate measured pre-randomisation\n2. A priori hypothesis\n3. Direction pre-specified\n4. One of few tests with multiplicity adjustment\n5. Within-study comparison (not between)\n6. Interaction test significant\n7. Statistically independent subgroup\n8. Large effect and all subgroups reported\n9. Consistent across related outcomes\n10. Consistent across studies\n11. Biological plausibility \u002F indirect evidence\n\n## Quantitative vs Qualitative Interaction\n\n**Gail-Simon 1985 *Biometrics* 41:361:** LR test against the \"all-same-direction\" null. Distinguishes quantitative (magnitude varies, direction preserved) from qualitative (sign reverses) — only the latter carries decision-changing weight clinically.\n\n**Pan-Wolfe 1997 *Stat Med* 16(14):1645, Li-Chan 2006 *J Biopharm Stat* 16(6):831:** tests for qualitative interaction of clinical significance; the original Gail-Simon normal-approximation LR is liberal at small n.\n\n**Why qualitative interaction matters for regulators:** may warrant restricting indication to the benefiting subgroup (label carve-out).\n\n## The Winner's Curse and Sun et al 2012\n\nSun et al 2012 *BMJ* systematic review found that of 207 trials reporting subgroup analyses, 64 claimed a primary-outcome subgroup effect, yet most claims failed the credibility criteria — the textbook winner's-curse signature, where effects in selected *significant* subgroups are inflated by chance and regression to the mean.\n\n**Mechanism:** selecting a subgroup conditional on its interaction p being small selects for upward sampling fluctuations; the posterior MLE conditional on selection is biased upward by ~SE × inverse Mills ratio at the selection threshold.\n\n**Mitigations:**\n\n- Bayesian shrinkage (Dixon-Simon, RBesT) — posterior subgroup means shrink to overall\n- Cross-validation (Athey-Wager honest splitting)\n- Yadlowsky RATE 2025 *JASA* — single-p omnibus test for whether CATE ranking has predictive vs prognostic value\n\n## Reconciliation: When Methods Disagree\n\n| Pattern | Likely cause | Action |\n|---------|--------------|--------|\n| Causal forest CATE shows HTE; interaction test in logistic non-significant | Causal forest detects nonlinear\u002Fmultivariate HTE; interaction test only linear bivariate | Causal forest with Yadlowsky RATE 2025 omnibus test is more sensitive; cite as discovery, not confirmatory; replicate in independent sample |\n| STEPP pattern significant at one window choice; flat at another | Window-size choice (sliding vs tail-oriented) affects results (Yip 2016; tail-oriented more stable than sliding) | Pre-specify window choice in SAP; report sensitivity over choices; use permutation supremum test |\n| Bayesian shrinkage (Dixon-Simon) yields null subgroup effect; frequentist sees signal | Shrinkage pulls subgroup posteriors toward overall trial effect | Bayesian shrinkage appropriate for replication PLANNING (Hemmings-Koch 2019), not signal generation; report frequentist as primary in discovery |\n| MH stratified analysis gives different pooled OR than logistic with strata as covariates | MH conditions on stratum; logistic does not (assumes additivity of strata effects) | Both are valid under different assumptions; logistic preferred when stratum-treatment interaction tested formally |\n| EXNEX basket trial gives different per-basket estimate under default 0.5\u002F0.5 vs 0.3\u002F0.7 mixture | Mixture weight controls borrowing strength (Neuenschwander 2016) | Sensitivity over weights 0.1-0.9; primary at 0.5\u002F0.5; cite range |\n| Gail-Simon qualitative interaction test rejects; LR interaction test does not | Qualitative test detects sign reversal; LR test detects magnitude | Both tests are answering different questions; qualitative interaction is regulatorily significant (label restriction) |\n| Subgroup signal from data-adaptive HTE method (SIDES, causal forest) without replication | Winner's curse (Sun 2012); effects in selected subgroups are inflated | Apply Bayesian shrinkage OR honest cross-validation; report as discovery only; require Phase 3 replication |\n| Causal forest test_calibration passes; RATE\u002FAUTOC fails | test_calibration measures any signal (prognostic OR predictive); RATE measures predictive value | RATE 2025 is the modern omnibus; should replace test_calibration as primary HTE check |\n\n## Per-Method Failure Modes\n\n### CMH masking Simpson's paradox\n\n- **Trigger:** Stratum-specific ORs reverse direction; pooled MH OR appears null.\n- **Mechanism:** CMH pools weighted log-ORs; opposite-sign equal-magnitude cancel.\n- **Symptom:** Breslow-Day p \u003C 0.05 with visible stratum sign reversal.\n- **Fix:** Report stratum-specific as primary; switch to logistic with interaction term; pooled OR invalid.\n\n### Breslow-Day false reassurance\n\n- **Trigger:** Few strata (k\u003C5) or sparse strata.\n- **Mechanism:** Low power; chi-square with k-1 df.\n- **Symptom:** Breslow-Day p>0.5 with forest plot showing visible heterogeneity.\n- **Fix:** Forest plot + LR interaction test from logistic regression.\n\n### STEPP correlated estimates with naive CI\n\n- **Trigger:** STEPP plot with naive pointwise CIs at each window.\n- **Mechanism:** Overlapping windows share patients; estimates are correlated.\n- **Symptom:** Apparent significance at individual windows that disappears under permutation.\n- **Fix:** Permutation-based supremum test of pattern flatness; report supremum p, not pointwise.\n\n### Causal forest without honest splitting\n\n- **Trigger:** Default settings without `honesty=TRUE`.\n- **Mechanism:** In-sample split selection biases leaf estimates.\n- **Symptom:** Over-fit CATE; failed `test_calibration`.\n- **Fix:** Always `honesty=TRUE`; tune via `tune.parameters=\"all\"`; cite Rehill 2025 audit.\n\n### Bayesian shrinkage damping real heterogeneity\n\n- **Trigger:** Hierarchical model fit during signal discovery (not replication planning).\n- **Mechanism:** Prior on tau forces subgroup effects toward overall.\n- **Symptom:** Subgroup detected by causal forest gets shrunken to null in shrinkage analysis.\n- **Fix:** Hemmings-Koch position — shrinkage for replication planning, NOT signal generation; cite Dane et al 2019 + critique.\n\n### EXNEX with default 0.5\u002F0.5 weights when one basket genuinely different\n\n- **Trigger:** Default mixture weights without elicitation.\n- **Mechanism:** 50% EX weight still allows substantial borrowing.\n- **Symptom:** Detected differential basket \"softened\" by borrowing.\n- **Fix:** Sensitivity analysis over mixture weights (0.1, 0.3, 0.5, 0.7, 0.9); report range.\n\n### Stratified randomisation ignored in subgroup analysis\n\n- **Trigger:** Site-stratified randomisation; subgroup analysis without site adjustment.\n- **Mechanism:** Achieved SE smaller than calculated SE.\n- **Symptom:** Over-conservative subgroup interaction tests (SE biased upward, Type-I below nominal, power loss).\n- **Fix:** Include stratification factors as model covariates (Kahan-Morris 2012).\n\n## Quantitative Thresholds\n\n| Threshold | Source | Rationale |\n|-----------|--------|-----------|\n| ~4x sample size for interaction detection vs main effect | Brookes et al 2004 *J Clin Epidemiol* 57:229 | Subgroup analyses are powered by interaction effect, not main effect |\n| 0.5σ standardised effect = \"noteworthy heterogeneity\" | Dane et al 2019 EFSPI white paper *Pharm Stat* 18:126 | Discipline for declaring subgroup signals worth pursuing |\n| Pre-specified subgroups for label claim | EMA 2019 subgroup guideline | Discovery subgroups cannot support indication restriction |\n| Bonferroni: ~10 subgroups -> 30-50% power loss vs Hommel | Sarkar 1998 | Subgroup tests positively correlated; Bonferroni over-conservative |\n| Honest splitting required for causal forest | Athey-Tibshirani-Wager 2019; Rehill 2025 | Without it, CIs are invalid; Rehill 2025 finds many applied papers omit it |\n| 11 credibility criteria | Sun BMJ 2012 344:e1553 | Canonical academic checklist; EMA 2019 implicitly references |\n| RATE\u002FAUTOC test (Yadlowsky 2025) | *JASA* 120(549):38-51 | Single-p omnibus for HTE-ranking predictive value |\n\n## Common Errors\n\n| Error \u002F symptom | Cause | Solution |\n|-----------------|-------|----------|\n| Per-subgroup p-values compared as evidence of HTE | Statistically invalid | Single model with interaction term; report interaction p, not per-subgroup p |\n| \"Non-significant interaction = no HTE\" | Underpowered interaction test | Cite Brookes 2004 4x rule; \"absence of evidence\" framing |\n| Breslow-Day non-sig taken as homogeneity | Low power with few strata | Forest plot + LR interaction; cite EMA 2019 |\n| STEPP with naive pointwise CIs reported | Correlated estimates | Permutation supremum test (R `stepp::test_pattern`) |\n| Causal forest CIs without honest splitting | Default settings | `honesty=TRUE`; tune; calibration test; cite Rehill 2025 |\n| Bayesian shrinkage for \"fishing\" subgroup discovery | Misapplication | Use for replication planning per Hemmings-Koch; cite Dane white paper |\n| Selected subgroup effect reported without shrinkage | Winner's curse | Apply Bayesian shrinkage (RBesT) or report selection-corrected estimate |\n| Subgroup p \u003C 0.05 claimed as evidence with no multiplicity | Common SAP omission | Graphical procedure with pre-specified alpha allocation (gMCP) |\n| MH pooled OR with sign-reversing stratum ORs | Simpson's paradox | Report stratum-specific; switch to interaction model |\n| Causal forest tau.hat reported without RATE test | Missing modern omnibus test | Yadlowsky 2025 RATE\u002FAUTOC; cite |\n\n## Anticipated Reviewer Pushback\n\n| Pushback | Response |\n|----------|----------|\n| \"Is this pre-specified?\" | Per EMA 2019, distinguish assessment (pre-specified, regulatory weight) vs discovery (post-hoc, hypothesis-generating); be explicit. |\n| \"Where is multiplicity correction?\" | Graphical procedure with alpha allocation per SAP; cite Bretz-Maurer 2009 + gMCP. |\n| \"Interaction power check?\" | Brookes 2004: ~4x main effect SS needed; report interaction power calculation in SAP. |\n| \"Is this finding clinically plausible?\" | Cite biological mechanism (e.g., known pharmacogenomic pathway); cite Sun 2012 criterion 11. |\n| \"Winner's curse control?\" | Bayesian shrinkage per Dixon-Simon (RBesT) for adjusted estimate; or honest cross-validation. |\n| \"Why STEPP not categorical subgroups?\" | Avoids arbitrary dichotomisation of continuous biomarker; cite Bonetti-Gelber 2004. |\n| \"Causal forest calibration?\" | `test_calibration` p-value reported; honest splitting enabled; cite Rehill 2025 audit standards. |\n| \"Sensitivity to prior in shrinkage analysis?\" | tau ~ HalfNormal(0, 0.1), 0.25, 0.5 reported; results stable across plausible priors. |\n\n## References\n\n- Athey S, Tibshirani J, Wager S. 2019. Generalized random forests. *Ann Stat* 47:1148-1178.\n- Berry SM, Broglio KR, Groshen S, Berry DA. 2013. Bayesian hierarchical modeling of patient subpopulations: efficient designs of Phase II oncology clinical trials. *Clin Trials* 10:720-734.\n- Bonetti M, Gelber RD. 2000. A graphical method to assess treatment-covariate interactions using the Cox model on subsets of the data. *Stat Med* 19(19):2595-2609.\n- Bonetti M, Gelber RD. 2004. Patterns of treatment effects in subsets of patients in clinical trials. *Biostatistics* 5:465-481.\n- Bretz F, Maurer W, Brannath W, Posch M. 2009. A graphical approach to sequentially rejective multiple test procedures. *Stat Med* 28:586-604.\n- Brookes ST, Whitely E, Egger M, Davey Smith G, Mulheran PA, Peters TJ. 2004. Subgroup analyses in randomized trials: risks of subgroup-specific analyses; power and sample size for the interaction test. *J Clin Epidemiol* 57:229-236. (Author surname is \"Whitely\", not \"Whitley\".)\n- Dane A, Spencer A, Rosenkranz G, Lipkovich I, Parke T. 2019. Subgroup analysis and interpretation for phase 3 confirmatory trials: white paper of the EFSPI\u002FPSI working group. *Pharm Stat* 18:126-139.\n- Dixon DO, Simon R. 1991. Bayesian subset analysis. *Biometrics* 47:871-881.\n- Dusseldorp E, Van Mechelen I. 2014. Qualitative interaction trees: a tool to identify qualitative treatment-subgroup interactions. *Stat Med* 33:219-237.\n- EMA. 2019. Guideline on the investigation of subgroups in confirmatory clinical trials. EMA\u002FCHMP\u002F539146\u002F2013.\n- Foster JC, Taylor JMG, Ruberg SJ. 2011. Subgroup identification from randomized clinical trial data. *Stat Med* 30:2867-2880.\n- Gail M, Simon R. 1985. Testing for qualitative interactions between treatment effects and patient subsets. *Biometrics* 41:361-372.\n- Goeman JJ, Hemerik J, Solari A. 2021. Only closed testing procedures are admissible for controlling false discovery proportions. *Ann Stat* 49:1218-1238.\n- Hemmings R, Koch A. 2019. Commentary on Dane et al. *Pharm Stat* 18:140-144.\n- Kahan BC, Morris TP. 2012. Improper analysis of trials randomised using stratified blocks or minimisation. *Stat Med* 31:328-340.\n- Künzel SR, Sekhon JS, Bickel PJ, Yu B. 2019. Metalearners for estimating heterogeneous treatment effects using machine learning. *PNAS* 116:4156-4165.\n- Lipkovich I, Dmitrienko A, Denne J, Enas G. 2011. Subgroup identification based on differential effect search: SIDES. *Stat Med* 30:2601-2621.\n- Neuenschwander B, Wandel S, Roychoudhury S, Bailey S. 2016. Robust exchangeability designs for early phase clinical trials with multiple strata. *Pharm Stat* 15:123-134.\n- Nie X, Wager S. 2021. Quasi-oracle estimation of heterogeneous treatment effects. *Biometrika* 108:299-319.\n- Pan G, Wolfe DA. 1997. Test for qualitative interaction of clinical significance. *Stat Med* 16(14):1645-1652.\n- Rehill P. 2025. How do applied researchers use the causal forest? A methodological review. *Int Stat Rev*.\n- Schmidli H, Gsteiger S, Roychoudhury S, O'Hagan A, Spiegelhalter D, Neuenschwander B. 2014. Robust meta-analytic-predictive priors in clinical trials with historical control information. *Biometrics* 70:1023-1032.\n- Senn S. 2018. Statistical pitfalls of personalised medicine. *Nature* 563:619-621.\n- Sun X, Briel M, Walter SD, Guyatt GH. 2010. Is a subgroup effect believable? Updating criteria to evaluate the credibility of subgroup analyses. *BMJ* 340:c117.\n- Sun X et al. 2012. Credibility of claims of subgroup effects in randomised controlled trials: systematic review. *BMJ* 344:e1553.\n- Wager S, Athey S. 2018. Estimation and inference of heterogeneous treatment effects using random forests. *JASA* 113:1228-1242.\n- Wang R, Lagakos SW, Ware JH, Hunter DJ, Drazen JM. 2007. Statistics in medicine -- reporting of subgroup analyses in clinical trials. *NEJM* 357:2189-2194.\n- Weber S, Li Y, Seaman J, Kakizume T, Schmidli H. 2021. Applying meta-analytic-predictive priors with the R Bayesian evidence synthesis tools. *J Stat Softw* 100:19.\n- Yadlowsky S, Fleming S, Shah N, Brunskill E, Wager S. 2025. Evaluating treatment prioritization rules via rank-weighted average treatment effects. *JASA* 120(549):38-51.\n\n## Related Skills\n\n- clinical-biostatistics\u002Fcategorical-tests - CMH, Breslow-Day, chi-square within strata\n- clinical-biostatistics\u002Feffect-measures - Forest plots, OR\u002FRR\u002FRD reporting\n- clinical-biostatistics\u002Flogistic-regression - Interaction terms in regression\n- clinical-biostatistics\u002Fmultiplicity-graphical - Bretz-Maurer graphical procedures (in depth)\n- clinical-biostatistics\u002Fbayesian-trials - MAP\u002FEXNEX\u002FBerry hierarchical models (in depth)\n- clinical-biostatistics\u002Ftrial-reporting - CONSORT 2025 + EMA 2019 reporting of subgroup analyses\n- experimental-design\u002Fmultiple-testing - General multiplicity correction methods\n- machine-learning\u002Fbiomarker-discovery - HTE for biomarker-defined subgroups\n","## Version Compatibility\n\nReference 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.\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- Python: `pip show \u003Cpackage>` then `help(module.function)` to check signatures\n- R: `packageVersion('\u003Cpkg>')` then `?function_name`\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.\n\n# Subgroup Analysis and Heterogeneous Treatment Effects\n\n**\"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.\n\n## The Senn Foundation -- Why Most Subgroup Claims Are Wrong\n\n**Senn 2018 *Nature* 563:619-621 (and *Statistical Issues in Drug Development* Ch. 9, 14):** observed between-patient response variation is NOT evidence of patient-level HTE. It conflates within-patient noise, period effects, regression-to-the-mean, and measurement error with true individual heterogeneity. Senn-Rolfe-Julious 2011 *SMMR* 20:657 documents that variance-component decomposition of replicate-crossover trials repeatedly fails to find subject-by-treatment interaction even where reviewers were certain one must exist.\n\n**Brookes et al 2004 *J Clin Epidemiol* 57:229 — the 4x penalty:** detecting a treatment-by-subgroup interaction requires approximately 4x the sample size needed to detect the main treatment effect of similar magnitude. A trial powered to detect OR=0.6 overall cannot reliably detect subgroup differences of similar magnitude. Non-significant interaction tests are usually underpowered, not null.\n\n**Senn's aphorism (paraphrased from SIDD):** \"a trial can have subgroup analyses or proper power, not both.\" A single trial cannot simultaneously be powered for a primary effect AND for credible subgroup discovery; pretending otherwise misrepresents posterior uncertainty.\n\n## Algorithmic Taxonomy\n\n| Method | What it answers | Inference | Strength | Fails when |\n|--------|-----------------|-----------|----------|------------|\n| Mantel-Haenszel \u002F CMH | Common OR across pre-defined strata | Asymptotic | Preserves stratification factor from randomisation | Stratum ORs reverse direction (Simpson) |\n| Breslow-Day | Homogeneity of stratum ORs | Asymptotic chi-square | Test of effect modification | Underpowered with few\u002Fsparse strata; non-significance NOT proof of homogeneity |\n| Gail-Simon 1985 | **Qualitative** interaction (sign reversal) | Likelihood ratio | Distinguishes quantitative from qualitative | Original LR is liberal at small n; use exact critical values (Pan-Wolfe 1997) |\n| Logistic regression interaction | Per-subgroup conditional OR | Wald, LR | Most efficient single-model approach | Conditional ORs subject to non-collapsibility; over-fits in multi-way |\n| RERI | Additive interaction on multiplicative scale | Delta-method or bootstrap CI | Captures public-health-relevant scale | Delta-method poor near boundary; nonlinear function of three ORs |\n| STEPP (Bonetti-Gelber 2000) | Continuous covariate subgroups via overlapping windows | Permutation supremum test | Avoids dichotomisation of biomarkers | Window-size choice affects results; correlated estimates require permutation inference |\n| SIDES \u002F SIDEScreen (Lipkovich 2011) | Data-discovered subgroups via recursive partitioning | Resampling-adjusted base-vs-complement p | Multiplicity correctly absorbed | Tuning skeleton parameters affects FWER calibration |\n| QUINT (Dusseldorp 2014) | Qualitative-interaction trees | Bootstrap stability | Directly tests crossover (A-better, B-better, equal) | Only two-arm continuous\u002Fbinary; survival extensions ad hoc |\n| Virtual Twins (Foster 2011) | Per-subject CATE via twin RF predictions | Bootstrap | Decouples nuisance from interpretable subgroup | Biased when RF underestimates effect heterogeneity in either arm |\n| Causal forests (Athey-Wager 2019) | Pointwise CATE with honest splits | Influence-function CI | Asymptotic Gaussianity; doubly robust via AIPW | Finite-sample CI validity at trial-scale n debated (Rehill 2025) |\n| Meta-learners X\u002FR-learner (Künzel 2019) | Marginal\u002Fconditional CATE | Cross-fit influence function | X-learner dominates T-learner when arms unbalanced | Needs propensity for X-learner; R-learner requires nuisance n^(1\u002F4) rate |\n| MOB (Zeileis 2008) | Parameter-instability trees | M-fluctuation test | Theoretically clean; invariant to monotone transforms | Worse out-of-sample CATE than causal forest at large p |\n| Bayesian shrinkage (Dixon-Simon 1991) | Posterior subgroup effects shrunken to overall | Posterior intervals from MCMC | Honest about prior expectation of no qualitative interaction | Prior choice on tau drives results; Dane et al 2019 white paper warns against for signal generation |\n| EXNEX (Neuenschwander 2016) | Mixture of exchangeable + per-basket non-exchangeable | Posterior | Avoids HM \"catastrophic borrowing\" when one basket truly different | Weight choice (often 0.5\u002F0.5 default) affects borrowing strength |\n\n**Postdoc reading list:**\n\n- Wang et al 2007 *NEJM* 357:2189 (\"Reporting of subgroup analyses in clinical trials\") — the canonical NEJM-mandated practice\n- Sun et al 2010\u002F2012 *BMJ* 340:c117 and 344:e1553 — 11 credibility criteria\n- Dane, Spencer, Rosenkranz, Lipkovich, Parke 2019 *Pharm Stat* 18:126 with Hemmings-Koch commentary at 18:140 — EFSPI white paper + critique\n- EMA 2019 Guideline on subgroups (EMA\u002FCHMP\u002F539146\u002F2013, effective Aug 2019) — distinguishes \"assessment subgroups\" (regulatory, pre-specified) from \"discovery subgroups\" (exploratory)\n- Athey & Wager 2019 *Observational Studies* 5:37; Athey, Tibshirani, Wager 2019 *Ann Stat* 47:1148 — causal forests\n- Rehill 2025 *Int Stat Rev* — applied causal forest audit; many papers misreport tuning and omit honest-splitting\u002Fcalibration diagnostics\n\n## Decision Tree by Scenario\n\n| Scenario | Recommended approach | Why |\n|----------|----------------------|-----|\n| Pre-specified subgroup in confirmatory trial | Interaction term in single model + graphical-procedure multiplicity (gMCP) | EMA 2019 \"assessment subgroup\"; interaction test + Bonferroni-graph alpha control |\n| Stratified randomisation by site\u002Fregion | CMH or logistic with strata as covariates; stratum-specific OR reported in forest plot | Kahan-Morris 2012; ignoring strata is over-conservative (SE biased upward, power loss); strata-specific ORs for transparency |\n| 5-15 pre-specified subgroups, regulatory submission | Forest plot + interaction tests + Holm\u002Fgraphical FWER correction | Default regulatory presentation; multiplicity adjustment expected |\n| Continuous biomarker subgroup (e.g., HbA1c, biomarker score) | STEPP (sliding-window plot + permutation supremum test) | Avoids arbitrary dichotomisation; cite Bonetti-Gelber 2004 |\n| Suspected qualitative interaction (treatment helps some, harms others) | Gail-Simon 1985 LR test with Pan-Wolfe 1997 exact critical values | Distinguishes quantitative from qualitative; critical for label restriction |\n| Data-discovery of HTE subgroup | SIDES\u002FSIDEScreen with permutation FWER + replication mandate | Lipkovich 2011; signal-discovery not signal-confirmation |\n| Continuous CATE estimation with many covariates | Causal forest (R `grf::causal_forest`) + RATE test (Yadlowsky 2025) | Modern HTE; honest splitting; influence-function CIs; RATE tests whether ranking is predictive vs prognostic |\n| Basket trial across rare-disease strata | EXNEX or robust MAP with `RBesT` | Borrows across strata while permitting one to detach if truly different |\n| Subgroup signal needing replication planning | Bayesian shrinkage for adjusted estimates; Sun 2012 winner's curse | Selected subgroups have inflated effect by selection bias |\n| Pediatric extrapolation borrowing from adult data | Power prior (gamma in 0.3-0.6) per FDA Bayesian draft Jan 2026 | Partial borrowing with discount; standard regulatory approach |\n\n## Mantel-Haenszel and Stratified Analysis\n\n**Goal:** Estimate a pooled treatment effect across strata while testing homogeneity.\n\n**Approach:** Construct per-stratum 2x2 tables; CMH for pooled OR and null test; Breslow-Day for homogeneity (with caveats).\n\n```python\nfrom statsmodels.stats.contingency_tables import StratifiedTable\nimport pandas as pd\nimport numpy as np\n\ntables = []\nfor stratum in df['site'].unique():\n    sub = df[df['site'] == stratum]\n    t = pd.crosstab(sub['treatment'], sub['outcome']).values\n    if t.shape == (2, 2) and t.min() > 0:\n        tables.append(t)\n\nst = StratifiedTable(tables)\nprint('MH pooled OR:', st.oddsratio_pooled)\nprint('95% CI:', st.oddsratio_pooled_confint())\nprint('CMH H0: common OR=1, p =', st.test_null_odds().pvalue)\nprint('Breslow-Day H0: equal ORs, p =', st.test_equal_odds().pvalue)\n```\n\n**Breslow-Day power trap:** with k=3 strata and modest heterogeneity, Breslow-Day power can be \u003C40%. Non-significance does NOT prove homogeneity — it just means the null cannot be rejected. Always supplement with a forest plot AND an LR interaction test from logistic regression.\n\n## Interaction Terms in Regression -- The Correct Way\n\n**Single model with interaction is the regulatory standard** — comparing p-values from separate per-subgroup models is statistically invalid (separate models have different power, and the p-value differences confound effect size with sample size).\n\n```python\nimport statsmodels.formula.api as smf\nimport numpy as np\n\n# Single model with interaction (CORRECT)\nmodel = smf.logit(\n    'outcome ~ C(treatment, Treatment(reference=\"Placebo\")) * C(age_group)',\n    data=df\n).fit()\n# Interaction coefficient tests effect modification\n# LR test: compare to additive model:\nadditive = smf.logit('outcome ~ C(treatment, Treatment(reference=\"Placebo\")) + C(age_group)', data=df).fit()\nlr_p = 1 - chi2.cdf(2 * (model.llf - additive.llf), model.df_model - additive.df_model)\n\n# Extract subgroup-specific ORs for reporting:\nfor group in df['age_group'].unique():\n    sub_model = smf.logit('outcome ~ C(treatment, Treatment(reference=\"Placebo\"))',\n                          data=df[df['age_group'] == group]).fit()\n    or_val = np.exp(sub_model.params.iloc[1])\n    ci = np.exp(sub_model.conf_int().iloc[1])\n    print(f'{group}: OR={or_val:.3f} ({ci[0]:.3f}-{ci[1]:.3f})')\n```\n\n## RERI for Additive Interaction\n\n```python\n# Fit interaction model: outcome ~ treatment + subgroup_indicator + treatment:subgroup_indicator\n# OR_11 = OR for treated in subgroup (vs untreated not in subgroup)\n# OR_10 = OR for treated not in subgroup\n# OR_01 = OR for untreated in subgroup\nreri = or_11 - or_10 - or_01 + 1\n# RERI > 0 = synergism (combined effect > sum of individual)\n# RERI = 0 = no additive interaction\n# RERI \u003C 0 = antagonism\n# CI requires delta method or bootstrap (nonlinear function of three ORs)\n```\n\n**Multiplicative vs additive interaction:** logistic regression tests multiplicative interaction (ratio of ORs). Null multiplicative interaction does NOT imply null additive interaction. For public health decisions, additive interaction is often more relevant.\n\n## Modern Data-Adaptive HTE Methods\n\n### STEPP (Subpopulation Treatment Effect Pattern Plot)\n\n```python\n# R recommended; Python equivalents are emerging\n# library(stepp)\n# subset_obj \u003C- new('stwin', type='sliding', r1=100, r2=200)  # window sizes\n# step_obj \u003C- stepp(eff='binary', cov='biomarker', trt='treatment',\n#                   resp='outcome', subset=subset_obj, ...)\n# plot(step_obj); test_pattern(step_obj, nperm=1000)\n```\n\nBonetti-Gelber 2000\u002F2004; window-size choice (sliding vs tail-oriented) affects results. **Naive simultaneous CIs are wrong** — estimates are correlated across windows; use permutation-based supremum tests of pattern flatness (Yip et al 2016 *Clin Trials* 13(4):382; tail-oriented STEPP is more stable than the sliding-window variant).\n\n### SIDES \u002F SIDEScreen\n\n```python\n# R: library(SIDES) or library(rsides)\n# Recursive partitioning with differential-effect splitting + permutation-adjusted subgroup p\n```\n\nLipkovich-Dmitrienko-Denne-Enas 2011 *Stat Med* 30:2601; SIDEScreen (Lipkovich-Dmitrienko 2014 *J Biopharm Stat* 24:130) adds variable-importance prefilter + base-vs-complement test. **The inferential complement test correctly absorbs multiplicity of considered splits** — Bonferroni alternatives over-correct.\n\n### Causal forests (Athey-Wager)\n\n```python\n# R recommended; econml is the Python equivalent\n# library(grf)\n# cf \u003C- causal_forest(X, Y, W, num.trees=2000)\n# tau.hat \u003C- predict(cf, X)$predictions\n# test_calibration(cf)  # omnibus calibration test\n```\n\n**Honest splitting** (one sub-sample for splits, another for leaf estimates) yields asymptotic Gaussianity and pointwise CIs (Athey-Tibshirani-Wager 2019 *Ann Stat* 47:1148). Doubly-robust variants use AIPW pseudo-outcomes.\n\n**Diagnostic discipline (Rehill 2025 audit):** applied causal-forest papers frequently misreport tuning, skip honest-splitting validation, or omit the `test_calibration` check. Required diagnostic steps:\n\n1. Honest splitting enabled (`honesty=TRUE`)\n2. `test_calibration(cf)` — regresses actual treatment effects on out-of-bag CATE predictions; significant positive slope = CATE has signal\n3. Variable importance via permutation\n4. RATE\u002FAUTOC test (Yadlowsky 2025 *JASA*) — single p-value omnibus test for whether CATE ranking has predictive (not just prognostic) value\n\n### Meta-learners (Künzel-Sekhon-Bickel-Yu 2019 *PNAS* 116:4156)\n\n- **S-learner:** single outcome model on (Z, X); take difference. Biased when treatment effect smaller than baseline effect.\n- **T-learner:** separate models per arm; take difference. Standard baseline.\n- **X-learner:** T-learner + cross-imputation + propensity weighting. Dominates T-learner when arms unbalanced (1:k, k>=3) or true CATE is smoother than response.\n- **R-learner (Nie-Wager 2021 *Biometrika* 108:299):** orthogonal Robinson-style residualisation, debiased ML. Asymptotically dominates X-learner when nuisance models converge at n^(1\u002F4) rate.\n\n```python\n# Python: econml\nfrom econml.dml import CausalForestDML, LinearDML\nfrom econml.metalearners import XLearner, TLearner\n# Or: from causalml.inference.meta import LRSRegressor, XGBTRegressor\n\nxl = XLearner(models=GradientBoostingRegressor(), propensity_model=LogisticRegression())\nxl.fit(Y, T=W, X=X)\ncate = xl.effect(X)\n```\n\n## Bayesian Shrinkage -- The Postdoc Argument\n\n**Dixon-Simon 1991 *Biometrics* 47:871:** exchangeable mean-zero prior on treatment-by-subgroup interaction coefficients; subgroup posteriors shrink to overall trial effect, proportional to evidence of heterogeneity. Honest about prior expectation that no qualitative interaction will hold.\n\n**Berry, Broglio, Groshen, Berry 2013 *Clin Trials* 10:720 (NOT JCO — common citation error):** hierarchical pooling across baskets calibrated by between-basket variance tau-squared. Inflated false-positives when tau-squared mis-specified (Freidlin-Korn 2013 *Clin Cancer Res* 19:1326 critique).\n\n**EXNEX (Neuenschwander, Wandel, Roychoudhury, Bailey 2016 *Pharm Stat* 15:123):** mixture of exchangeable (shared mean+variance) + non-exchangeable (per-basket independent) components, typically weighted 0.5\u002F0.5. Avoids HM catastrophic borrowing when one basket truly different. Now near-standard in oncology basket trials.\n\n**MAP priors (Schmidli et al 2014 *Biometrics* 70:1023):** meta-analytic-predictive prior. Fit random-effects meta-analysis of historical control arms, derive predictive distribution for new control arm, use as informative prior. Effective sample size from history typically 20-80% of new control arm. **Robust MAP** adds vague mixture component (weight 0.1-0.3) to guard against prior-data conflict. R `RBesT` is the canonical CRAN tool (Weber et al 2021 *J Stat Softw* 100:19).\n\n**The Dane vs Hemmings argument:**\n\n- Dane et al 2019 *Pharm Stat* 18:126 (EFSPI white paper): propose a standardised-effect benchmark in the neighbourhood of ~0.5σ for \"noteworthy heterogeneity\" (verify the exact figure against the white paper before quoting); tiered structure (key\u002Fimportant\u002Fexploratory); signal-vs-noise diagnostics.\n- Hemmings & Koch 2019 *Pharm Stat* 18:140 commentary: **explicitly REJECT Bayesian shrinkage for signal generation** because \"Bayesian shrinkage assumes treatment effects are consistent\" and pre-emptively damps the very heterogeneity one is searching for. Shrinkage is endorsed only for *post-signal replication planning*.\n\n**What postdocs argue about:** whether shrinkage is appropriate at the signal-generation stage; the prior on tau drives everything (Senn-style: tau ~ HalfNormal(0, 0.1); regulatory-tolerant: tau ~ HalfNormal(0, 0.5)).\n\n## Multiplicity for Subgroup Analyses\n\n**Bonferroni is rarely right** for subgroup tests because they are heavily positively correlated (same outcome, overlapping samples). Bonferroni assumes worst-case dependence; loses 30-50% power vs Hommel\u002Fresampling for ~10 demographic subgroups.\n\n**Graphical procedures (Bretz-Maurer-Hommel)** — see clinical-biostatistics\u002Fmultiplicity-graphical for full treatment. The graph for a typical subgroup analysis SAP:\n\n- Primary endpoint at full alpha\n- Alpha propagates to \"key secondary\" endpoints if primary rejects\n- Alpha propagates to pre-specified subgroup interaction tests if primary rejects\n- Discovery subgroups at most receive a small alpha slice (Dane et al recommend \u003C=20%)\n\n```python\n# R: library(gMCP); graphView(graphMCP(...))  # interactive or programmatic\n```\n\n**Goeman, Hemerik, Solari 2021 *Ann Stat* 49:1218:** \"only closed testing procedures are admissible for controlling FDP\u002FFWER\u002Fk-FWER\" — graphical, gatekeeping, Hommel, fallback are all closed tests in disguise. The graph IS the procedure.\n\n## Pre-Specified vs Post-Hoc and EMA 2019\n\n| Aspect | Pre-specified (\"assessment\") | Post-hoc (\"discovery\") |\n|--------|------------------------------|------------------------|\n| Timing | Before unblinding, in SAP | After seeing data |\n| Credibility | High if biologically justified | Low; hypothesis-generating only |\n| Regulatory weight per EMA 2019 | Can support labeling claims | Cannot support claims alone |\n| Multiplicity adjustment | Required per SAP (graphical or Holm) | Required + heavy skepticism |\n| Number expected | Few (5-15); pre-justified | Unlimited but unblindable |\n\n**EMA 2019 Guideline on Investigation of Subgroups in Confirmatory Trials (EMA\u002FCHMP\u002F539146\u002F2013, effective Aug 2019)** position: interaction tests alone are \"neither necessary nor sufficient\"; consistency is a holistic judgment; subgroup-specific licensing requires pre-specified evidence of differential effect PLUS biological rationale.\n\n**Sun BMJ 2012 11 credibility criteria** (the canonical academic framework):\n\n1. Covariate measured pre-randomisation\n2. A priori hypothesis\n3. Direction pre-specified\n4. One of few tests with multiplicity adjustment\n5. Within-study comparison (not between)\n6. Interaction test significant\n7. Statistically independent subgroup\n8. Large effect and all subgroups reported\n9. Consistent across related outcomes\n10. Consistent across studies\n11. Biological plausibility \u002F indirect evidence\n\n## Quantitative vs Qualitative Interaction\n\n**Gail-Simon 1985 *Biometrics* 41:361:** LR test against the \"all-same-direction\" null. Distinguishes quantitative (magnitude varies, direction preserved) from qualitative (sign reverses) — only the latter carries decision-changing weight clinically.\n\n**Pan-Wolfe 1997 *Stat Med* 16(14):1645, Li-Chan 2006 *J Biopharm Stat* 16(6):831:** tests for qualitative interaction of clinical significance; the original Gail-Simon normal-approximation LR is liberal at small n.\n\n**Why qualitative interaction matters for regulators:** may warrant restricting indication to the benefiting subgroup (label carve-out).\n\n## The Winner's Curse and Sun et al 2012\n\nSun et al 2012 *BMJ* systematic review found that of 207 trials reporting subgroup analyses, 64 claimed a primary-outcome subgroup effect, yet most claims failed the credibility criteria — the textbook winner's-curse signature, where effects in selected *significant* subgroups are inflated by chance and regression to the mean.\n\n**Mechanism:** selecting a subgroup conditional on its interaction p being small selects for upward sampling fluctuations; the posterior MLE conditional on selection is biased upward by ~SE × inverse Mills ratio at the selection threshold.\n\n**Mitigations:**\n\n- Bayesian shrinkage (Dixon-Simon, RBesT) — posterior subgroup means shrink to overall\n- Cross-validation (Athey-Wager honest splitting)\n- Yadlowsky RATE 2025 *JASA* — single-p omnibus test for whether CATE ranking has predictive vs prognostic value\n\n## Reconciliation: When Methods Disagree\n\n| Pattern | Likely cause | Action |\n|---------|--------------|--------|\n| Causal forest CATE shows HTE; interaction test in logistic non-significant | Causal forest detects nonlinear\u002Fmultivariate HTE; interaction test only linear bivariate | Causal forest with Yadlowsky RATE 2025 omnibus test is more sensitive; cite as discovery, not confirmatory; replicate in independent sample |\n| STEPP pattern significant at one window choice; flat at another | Window-size choice (sliding vs tail-oriented) affects results (Yip 2016; tail-oriented more stable than sliding) | Pre-specify window choice in SAP; report sensitivity over choices; use permutation supremum test |\n| Bayesian shrinkage (Dixon-Simon) yields null subgroup effect; frequentist sees signal | Shrinkage pulls subgroup posteriors toward overall trial effect | Bayesian shrinkage appropriate for replication PLANNING (Hemmings-Koch 2019), not signal generation; report frequentist as primary in discovery |\n| MH stratified analysis gives different pooled OR than logistic with strata as covariates | MH conditions on stratum; logistic does not (assumes additivity of strata effects) | Both are valid under different assumptions; logistic preferred when stratum-treatment interaction tested formally |\n| EXNEX basket trial gives different per-basket estimate under default 0.5\u002F0.5 vs 0.3\u002F0.7 mixture | Mixture weight controls borrowing strength (Neuenschwander 2016) | Sensitivity over weights 0.1-0.9; primary at 0.5\u002F0.5; cite range |\n| Gail-Simon qualitative interaction test rejects; LR interaction test does not | Qualitative test detects sign reversal; LR test detects magnitude | Both tests are answering different questions; qualitative interaction is regulatorily significant (label restriction) |\n| Subgroup signal from data-adaptive HTE method (SIDES, causal forest) without replication | Winner's curse (Sun 2012); effects in selected subgroups are inflated | Apply Bayesian shrinkage OR honest cross-validation; report as discovery only; require Phase 3 replication |\n| Causal forest test_calibration passes; RATE\u002FAUTOC fails | test_calibration measures any signal (prognostic OR predictive); RATE measures predictive value | RATE 2025 is the modern omnibus; should replace test_calibration as primary HTE check |\n\n## Per-Method Failure Modes\n\n### CMH masking Simpson's paradox\n\n- **Trigger:** Stratum-specific ORs reverse direction; pooled MH OR appears null.\n- **Mechanism:** CMH pools weighted log-ORs; opposite-sign equal-magnitude cancel.\n- **Symptom:** Breslow-Day p \u003C 0.05 with visible stratum sign reversal.\n- **Fix:** Report stratum-specific as primary; switch to logistic with interaction term; pooled OR invalid.\n\n### Breslow-Day false reassurance\n\n- **Trigger:** Few strata (k\u003C5) or sparse strata.\n- **Mechanism:** Low power; chi-square with k-1 df.\n- **Symptom:** Breslow-Day p>0.5 with forest plot showing visible heterogeneity.\n- **Fix:** Forest plot + LR interaction test from logistic regression.\n\n### STEPP correlated estimates with naive CI\n\n- **Trigger:** STEPP plot with naive pointwise CIs at each window.\n- **Mechanism:** Overlapping windows share patients; estimates are correlated.\n- **Symptom:** Apparent significance at individual windows that disappears under permutation.\n- **Fix:** Permutation-based supremum test of pattern flatness; report supremum p, not pointwise.\n\n### Causal forest without honest splitting\n\n- **Trigger:** Default settings without `honesty=TRUE`.\n- **Mechanism:** In-sample split selection biases leaf estimates.\n- **Symptom:** Over-fit CATE; failed `test_calibration`.\n- **Fix:** Always `honesty=TRUE`; tune via `tune.parameters=\"all\"`; cite Rehill 2025 audit.\n\n### Bayesian shrinkage damping real heterogeneity\n\n- **Trigger:** Hierarchical model fit during signal discovery (not replication planning).\n- **Mechanism:** Prior on tau forces subgroup effects toward overall.\n- **Symptom:** Subgroup detected by causal forest gets shrunken to null in shrinkage analysis.\n- **Fix:** Hemmings-Koch position — shrinkage for replication planning, NOT signal generation; cite Dane et al 2019 + critique.\n\n### EXNEX with default 0.5\u002F0.5 weights when one basket genuinely different\n\n- **Trigger:** Default mixture weights without elicitation.\n- **Mechanism:** 50% EX weight still allows substantial borrowing.\n- **Symptom:** Detected differential basket \"softened\" by borrowing.\n- **Fix:** Sensitivity analysis over mixture weights (0.1, 0.3, 0.5, 0.7, 0.9); report range.\n\n### Stratified randomisation ignored in subgroup analysis\n\n- **Trigger:** Site-stratified randomisation; subgroup analysis without site adjustment.\n- **Mechanism:** Achieved SE smaller than calculated SE.\n- **Symptom:** Over-conservative subgroup interaction tests (SE biased upward, Type-I below nominal, power loss).\n- **Fix:** Include stratification factors as model covariates (Kahan-Morris 2012).\n\n## Quantitative Thresholds\n\n| Threshold | Source | Rationale |\n|-----------|--------|-----------|\n| ~4x sample size for interaction detection vs main effect | Brookes et al 2004 *J Clin Epidemiol* 57:229 | Subgroup analyses are powered by interaction effect, not main effect |\n| 0.5σ standardised effect = \"noteworthy heterogeneity\" | Dane et al 2019 EFSPI white paper *Pharm Stat* 18:126 | Discipline for declaring subgroup signals worth pursuing |\n| Pre-specified subgroups for label claim | EMA 2019 subgroup guideline | Discovery subgroups cannot support indication restriction |\n| Bonferroni: ~10 subgroups -> 30-50% power loss vs Hommel | Sarkar 1998 | Subgroup tests positively correlated; Bonferroni over-conservative |\n| Honest splitting required for causal forest | Athey-Tibshirani-Wager 2019; Rehill 2025 | Without it, CIs are invalid; Rehill 2025 finds many applied papers omit it |\n| 11 credibility criteria | Sun BMJ 2012 344:e1553 | Canonical academic checklist; EMA 2019 implicitly references |\n| RATE\u002FAUTOC test (Yadlowsky 2025) | *JASA* 120(549):38-51 | Single-p omnibus for HTE-ranking predictive value |\n\n## Common Errors\n\n| Error \u002F symptom | Cause | Solution |\n|-----------------|-------|----------|\n| Per-subgroup p-values compared as evidence of HTE | Statistically invalid | Single model with interaction term; report interaction p, not per-subgroup p |\n| \"Non-significant interaction = no HTE\" | Underpowered interaction test | Cite Brookes 2004 4x rule; \"absence of evidence\" framing |\n| Breslow-Day non-sig taken as homogeneity | Low power with few strata | Forest plot + LR interaction; cite EMA 2019 |\n| STEPP with naive pointwise CIs reported | Correlated estimates | Permutation supremum test (R `stepp::test_pattern`) |\n| Causal forest CIs without honest splitting | Default settings | `honesty=TRUE`; tune; calibration test; cite Rehill 2025 |\n| Bayesian shrinkage for \"fishing\" subgroup discovery | Misapplication | Use for replication planning per Hemmings-Koch; cite Dane white paper |\n| Selected subgroup effect reported without shrinkage | Winner's curse | Apply Bayesian shrinkage (RBesT) or report selection-corrected estimate |\n| Subgroup p \u003C 0.05 claimed as evidence with no multiplicity | Common SAP omission | Graphical procedure with pre-specified alpha allocation (gMCP) |\n| MH pooled OR with sign-reversing stratum ORs | Simpson's paradox | Report stratum-specific; switch to interaction model |\n| Causal forest tau.hat reported without RATE test | Missing modern omnibus test | Yadlowsky 2025 RATE\u002FAUTOC; cite |\n\n## Anticipated Reviewer Pushback\n\n| Pushback | Response |\n|----------|----------|\n| \"Is this pre-specified?\" | Per EMA 2019, distinguish assessment (pre-specified, regulatory weight) vs discovery (post-hoc, hypothesis-generating); be explicit. |\n| \"Where is multiplicity correction?\" | Graphical procedure with alpha allocation per SAP; cite Bretz-Maurer 2009 + gMCP. |\n| \"Interaction power check?\" | Brookes 2004: ~4x main effect SS needed; report interaction power calculation in SAP. |\n| \"Is this finding clinically plausible?\" | Cite biological mechanism (e.g., known pharmacogenomic pathway); cite Sun 2012 criterion 11. |\n| \"Winner's curse control?\" | Bayesian shrinkage per Dixon-Simon (RBesT) for adjusted estimate; or honest cross-validation. |\n| \"Why STEPP not categorical subgroups?\" | Avoids arbitrary dichotomisation of continuous biomarker; cite Bonetti-Gelber 2004. |\n| \"Causal forest calibration?\" | `test_calibration` p-value reported; honest splitting enabled; cite Rehill 2025 audit standards. |\n| \"Sensitivity to prior in shrinkage analysis?\" | tau ~ HalfNormal(0, 0.1), 0.25, 0.5 reported; results stable across plausible priors. |\n\n## References\n\n- Athey S, Tibshirani J, Wager S. 2019. Generalized random forests. *Ann Stat* 47:1148-1178.\n- Berry SM, Broglio KR, Groshen S, Berry DA. 2013. Bayesian hierarchical modeling of patient subpopulations: efficient designs of Phase II oncology clinical trials. *Clin Trials* 10:720-734.\n- Bonetti M, Gelber RD. 2000. A graphical method to assess treatment-covariate interactions using the Cox model on subsets of the data. *Stat Med* 19(19):2595-2609.\n- Bonetti M, Gelber RD. 2004. Patterns of treatment effects in subsets of patients in clinical trials. *Biostatistics* 5:465-481.\n- Bretz F, Maurer W, Brannath W, Posch M. 2009. A graphical approach to sequentially rejective multiple test procedures. *Stat Med* 28:586-604.\n- Brookes ST, Whitely E, Egger M, Davey Smith G, Mulheran PA, Peters TJ. 2004. Subgroup analyses in randomized trials: risks of subgroup-specific analyses; power and sample size for the interaction test. *J Clin Epidemiol* 57:229-236. (Author surname is \"Whitely\", not \"Whitley\".)\n- Dane A, Spencer A, Rosenkranz G, Lipkovich I, Parke T. 2019. Subgroup analysis and interpretation for phase 3 confirmatory trials: white paper of the EFSPI\u002FPSI working group. *Pharm Stat* 18:126-139.\n- Dixon DO, Simon R. 1991. Bayesian subset analysis. *Biometrics* 47:871-881.\n- Dusseldorp E, Van Mechelen I. 2014. Qualitative interaction trees: a tool to identify qualitative treatment-subgroup interactions. *Stat Med* 33:219-237.\n- EMA. 2019. Guideline on the investigation of subgroups in confirmatory clinical trials. EMA\u002FCHMP\u002F539146\u002F2013.\n- Foster JC, Taylor JMG, Ruberg SJ. 2011. Subgroup identification from randomized clinical trial data. *Stat Med* 30:2867-2880.\n- Gail M, Simon R. 1985. Testing for qualitative interactions between treatment effects and patient subsets. *Biometrics* 41:361-372.\n- Goeman JJ, Hemerik J, Solari A. 2021. Only closed testing procedures are admissible for controlling false discovery proportions. *Ann Stat* 49:1218-1238.\n- Hemmings R, Koch A. 2019. Commentary on Dane et al. *Pharm Stat* 18:140-144.\n- Kahan BC, Morris TP. 2012. Improper analysis of trials randomised using stratified blocks or minimisation. *Stat Med* 31:328-340.\n- Künzel SR, Sekhon JS, Bickel PJ, Yu B. 2019. Metalearners for estimating heterogeneous treatment effects using machine learning. *PNAS* 116:4156-4165.\n- Lipkovich I, Dmitrienko A, Denne J, Enas G. 2011. Subgroup identification based on differential effect search: SIDES. *Stat Med* 30:2601-2621.\n- Neuenschwander B, Wandel S, Roychoudhury S, Bailey S. 2016. Robust exchangeability designs for early phase clinical trials with multiple strata. *Pharm Stat* 15:123-134.\n- Nie X, Wager S. 2021. Quasi-oracle estimation of heterogeneous treatment effects. *Biometrika* 108:299-319.\n- Pan G, Wolfe DA. 1997. Test for qualitative interaction of clinical significance. *Stat Med* 16(14):1645-1652.\n- Rehill P. 2025. How do applied researchers use the causal forest? A methodological review. *Int Stat Rev*.\n- Schmidli H, Gsteiger S, Roychoudhury S, O'Hagan A, Spiegelhalter D, Neuenschwander B. 2014. Robust meta-analytic-predictive priors in clinical trials with historical control information. *Biometrics* 70:1023-1032.\n- Senn S. 2018. Statistical pitfalls of personalised medicine. *Nature* 563:619-621.\n- Sun X, Briel M, Walter SD, Guyatt GH. 2010. Is a subgroup effect believable? Updating criteria to evaluate the credibility of subgroup analyses. *BMJ* 340:c117.\n- Sun X et al. 2012. Credibility of claims of subgroup effects in randomised controlled trials: systematic review. *BMJ* 344:e1553.\n- Wager S, Athey S. 2018. Estimation and inference of heterogeneous treatment effects using random forests. *JASA* 113:1228-1242.\n- Wang R, Lagakos SW, Ware JH, Hunter DJ, Drazen JM. 2007. Statistics in medicine -- reporting of subgroup analyses in clinical trials. *NEJM* 357:2189-2194.\n- Weber S, Li Y, Seaman J, Kakizume T, Schmidli H. 2021. Applying meta-analytic-predictive priors with the R Bayesian evidence synthesis tools. *J Stat Softw* 100:19.\n- Yadlowsky S, Fleming S, Shah N, Brunskill E, Wager S. 2025. Evaluating treatment prioritization rules via rank-weighted average treatment effects. *JASA* 120(549):38-51.\n\n## Related Skills\n\n- clinical-biostatistics\u002Fcategorical-tests - CMH, Breslow-Day, chi-square within strata\n- clinical-biostatistics\u002Feffect-measures - Forest plots, OR\u002FRR\u002FRD reporting\n- clinical-biostatistics\u002Flogistic-regression - Interaction terms in regression\n- clinical-biostatistics\u002Fmultiplicity-graphical - Bretz-Maurer graphical procedures (in depth)\n- clinical-biostatistics\u002Fbayesian-trials - MAP\u002FEXNEX\u002FBerry hierarchical models (in depth)\n- clinical-biostatistics\u002Ftrial-reporting - CONSORT 2025 + EMA 2019 reporting of subgroup analyses\n- experimental-design\u002Fmultiple-testing - General multiplicity correction methods\n- machine-learning\u002Fbiomarker-discovery - HTE for biomarker-defined subgroups\n",{"name":5,"source":24,"license":15,"tool_type":25,"description":7,"imported_at":26,"source_path":27,"primary_tool":28,"source_repository":29},"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills","python","2026-09-20","clinical-biostatistics\u002Fsubgroup-analysis\u002FSKILL.md","statsmodels","GPTomics\u002FbioSkills","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fbiology\u002Fbio-clinical-biostatistics-subgroup-analysis","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous","2026-11-09 11:45:36",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-clinical-biostatistics-subgroup-analysis",{"tool":42,"command":43},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-clinical-biostatistics-subgroup-analysis",{"tool":45,"command":46},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-clinical-biostatistics-subgroup-analysis","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-clinical-biostatistics-subgroup-analysis\u002FSKILL.md",true,[50,56],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"examples\u002Fsubgroup_analysis_clinical.py","SCRIPT","脚本",3706,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-clinical-biostatistics-subgroup-analysis\u002Fexamples\u002Fsubgroup_analysis_clinical.py",{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"usage-guide.md","REFERENCE","参考文档",7022,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-clinical-biostatistics-subgroup-analysis\u002Fusage-guide.md",[63,71,78,85,92,99],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":70},"01M7FFFZPC2025JQQHPHDX154J","dei-assessment","Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-assessment\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":70},"01M7FFFWN8H4WA7A6Y398QKB6J","dei-action-plan","Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-action-plan\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":70},"01M7FFFSHTM0QZRVZ2NRJTJ0PY","culture-fit-assessment","Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fculture-fit-assessment\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":70},"01M7FFFMA12RKEQA38KHJSXXPS","cowork-to-code-bridge","Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcowork-to-code-bridge\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":70},"01M7FFFH1F6M8YRGW5V487GH1K","counter-offer-response","Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcounter-offer-response\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":70},"01M7FFFDGEHV8Y7J9N40HZXW52","continuous-feedback-system","Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcontinuous-feedback-system\u002FSKILL.md",[],[]]