From itc-modeling
Deep methodology knowledge for STC including outcome regression approach, effect modifier selection, covariate centering, and comparison with MAIC. Use when conducting or reviewing STC analyses.
npx claudepluginhub choxos/biostatagent --plugin itc-modelingThis skill uses the workspace's default tool permissions.
Comprehensive methodological guidance for conducting rigorous Simulated Treatment Comparisons following NICE DSU TSD 18.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
Comprehensive methodological guidance for conducting rigorous Simulated Treatment Comparisons following NICE DSU TSD 18.
STC Approach:
MAIC Approach:
logit(P(Y=1)) = β₀ + β_trt × Treatment + β_X × X + β_trt:X × Treatment × X
Where:
- β_trt: Treatment effect when X = 0
- β_X: Effect of covariate X on outcome
- β_trt:X: Treatment-covariate interaction (effect modification)
For anchored STC:
1. Center X on external population mean: X_centered = X - X_external
2. Fit model with centered X
3. β_trt now represents treatment effect at external population values
Same as MAIC:
Additional assumption vs MAIC:
Trade-off:
├── If model correct → STC more efficient than MAIC
├── If model wrong → STC may be biased
└── MAIC doesn't require outcome model specification
A covariate that interacts with treatment effect:
Effect Modifier Identification:
├── 1. Clinical/Biological Rationale
│ - Published literature on effect modification
│ - Mechanism of action considerations
│ - Expert clinical input
│
├── 2. Statistical Evidence (from IPD)
│ - Interaction terms in regression
│ - Subgroup analyses
│ - Use α = 0.10 (underpowered for interactions)
│
├── 3. Availability in AgD
│ - Must have summary statistics
│ - Means for continuous, proportions for binary
│
└── 4. Imbalance Between Populations
- Focus on covariates that differ
- Balanced covariates less important
em_result <- identify_effect_modifiers(
data = ipd_data,
outcome_var = "response",
treatment_var = "treatment",
candidate_covariates = c("age", "sex", "biomarker", "stage"),
alpha = 0.10
)
# Returns:
# - Interaction p-values
# - Interaction coefficients
# - Recommended effect modifiers
Without centering (X = raw values):
- β_trt = treatment effect when ALL covariates = 0
- This may be meaningless (e.g., age = 0)
With centering (X_centered = X - X_external):
- β_trt = treatment effect when X = X_external
- This is the effect in external trial population
- Exactly what we need for ITC
# For continuous covariate
age_centered <- age - agd_mean_age
# For binary covariate
male_centered <- male - agd_prop_male
# Result: mean of centered covariate = (IPD mean - AgD mean)
# When evaluated at X_centered = 0, we get AgD population
With interactions:
# Model: Y ~ treatment + X_centered + treatment:X_centered
# β_trt: effect at X = X_external
# β_trt:X: how effect changes with X
Main effects typically included even if not "significant":
Setup:
- IPD trial: A vs Common (C)
- AgD trial: B vs Common (C)
Steps:
1. Center covariates on AgD population
2. Fit: logit(Y) ~ Treatment + X_centered + Treatment:X_centered
3. Extract β_A (A vs C at AgD population)
4. Calculate d_BC from AgD (B vs C)
5. Indirect: d_AB = β_A - d_BC
Setup:
- IPD trial: Treatment A only (or A vs something)
- AgD: Single-arm Treatment B
Caution: Same issues as unanchored MAIC
- Must adjust for ALL prognostic factors
- Assumes absolute effects transportable
- Strong assumptions - use as sensitivity only
| Aspect | STC | MAIC |
|---|---|---|
| Method | Outcome regression | Propensity weighting |
| Efficiency | Higher (if model correct) | Lower (ESS reduction) |
| Model dependence | Higher | Lower |
| Continuous covariates | Natural | May need categorization |
| Extrapolation | Possible (with caution) | Limited to overlap |
| Diagnostic | Model fit, residuals | ESS, weight distribution |
# Run both methods
stc_result <- anchored_stc_binary(...)
maic_result <- maic_anchored(...)
# Compare results
# If similar: increased confidence
# If different: investigate why
# Treatment effect prior
prior_normal(0, 10) # Weakly informative
# Covariate effects
prior_normal(0, 5)
# Interactions (typically smaller)
prior_normal(0, 2)
# Sensitivity analysis with different priors
bayes_result <- bayesian_anchored_stc_binary(
ipd_data = ipd,
agd_data = agd,
outcome_var = "response",
treatment_var = "treatment",
covariates = c("age", "sex"),
priors = list(
treatment = prior_normal(0, 10),
covariates = prior_normal(0, 5),
interactions = prior_normal(0, 2)
),
n_iter = 10000,
n_warmup = 2000,
seed = 12345
)
library(stc)
# 1. Identify effect modifiers
em <- identify_effect_modifiers(
data = ipd,
outcome_var = "response",
treatment_var = "treatment",
candidate_covariates = c("age", "sex", "biomarker"),
alpha = 0.10
)
# 2. Run anchored STC (frequentist)
result <- anchored_stc_binary(
ipd_data = ipd,
agd_data = list(
n_total_A = 150, n_total_C = 150,
n_events_A = 45, n_events_C = 60,
covariates = list(
age = list(mean = 62),
sex = list(prop = 0.55)
)
),
outcome_var = "response",
treatment_var = "treatment",
covariates = c("age", "sex"),
reference_arm = "A",
include_interactions = TRUE,
robust_se = TRUE
)
# 3. View results
print(result)
summary(result)
# 4. Access specific effects
result$treatment_effect_BC # Indirect comparison
result$treatment_effect_AB # Direct from IPD
result$treatment_effect_AC # From AgD
# 5. Bayesian sensitivity
bayes_result <- bayesian_anchored_stc_binary(
...,
priors = list(
treatment = prior_normal(0, 10)
)
)