Evaluates CAMS modifier-specific treatment effects at the pooled
(precision-weighted) information fraction from ifrac(). Vignettes often
use published subgroup tables (IV/NIV, age strata, …); the same
extractor applies whenever each trial contributes one estimate per
modifier level (long format). The modifier column defaults to
"level"; pass modifier = on cams() to use another column name.
Display headings capitalize the first letter of that column name.
Usage
modifiers(
fit,
at = NULL,
ifrac = NULL,
type = c("Overall", "Prediction"),
prob = NULL,
max_support = NULL,
summary = TRUE,
contrast_sep = NULL,
exponentiate = NULL,
shrinkage = FALSE,
contribution
)Arguments
- fit
A
interactmetafromcams().- at
Combined-population information fraction \(\pi\) at which to evaluate subgroup effects. If
NULL(default), uses the pooled reporting IF fromifrac()forfit. A numeric vector is aligned to posterior draws; a scalar (e.g.at = 0.5) is a plug-in at every draw.- ifrac
When
atisNULL, passed toifrac():"interaction"(default; interaction-weighted pooling of trial-level \(\pi_j\)) or"overall"for overall-block precision weights.- type
One or both of
"Overall"and"Prediction"."Overall"uses fixed effects only;"Prediction"adds a new-trial random effect drawn from the posterior trial SDs at the combined-population IF (effect in a new trial).- prob
Coverage probability for
lci/uciwhensummary = TRUE.- max_support
Optional cap on unweighted posterior rows. Rejected for Bayesian CAMS DIRECT supports (weighted quadrature nodes); omit it.
- summary
If
TRUE(default), include a summary data frame.- contrast_sep
Rows whose
subgrouplabel contains this separator are excluded when resolving subgroup levels (default"-").- exponentiate
If
TRUE, transform posterior draws withexp()before summarizing (e.g. log rate ratios to ratios).- shrinkage
If
TRUE, delegate toshrinkage()withtype = "modifiers"(trial-specific reconstruction at each trial's \(\pi_j\)). IfFALSE(default), return only Overall / Prediction at the combined-population information fraction.- contribution
Deprecated; use
\code{at}.
Value
A interactmeta_subgroup_effects object (list with draws, summary,
overall_ifrac, overall_ifrac_source ("fit" or "user"), reference,
prob, exponentiate). Draws are indexed by subgroup and type.
summary includes estimate (median), mean, sd, lci, and uci.
For Bayesian CAMS, lci/uci follow fit$interval.type (default
central) on the DIRECT-node mixture.
Details
This is not a marginal treatment effect in the survey-sampling sense: it is the modifier-level linear predictor at the combined-population contribution structure \(\widetilde{\pi}\).
For each posterior draw, the linear predictor is evaluated at that draw's
combined-population information fraction with the appropriate subgroup
fixed effect:
$$\mu_A(\pi^\star)=\alpha+\pi^\star(\theta-\gamma),$$
$$\mu_B(\pi^\star)=\alpha+\pi^\star(\theta-\gamma)+\gamma.$$
On the orthogonal CAMS factorization, \(\theta\) is the overall-block IF slope and
stored b_ifrac is \(\beta=\theta-\gamma\). This is not the
trial-specific convolution on fit$latent$mu_A[[j]] /
fit$latent$mu_B[[j]] (\(\mu_{Aj}=m_j-\pi_j g_j\) at that trial's
\(\pi_j\)). A scalar at is a plug-in \(\pi^\star\);
NULL mixes the ifrac() posterior.
\(\alpha\) and \(\theta\) share the overall-block support. Population \(M^\star=\alpha+\pi^\star\theta\) is formed from that joint, not by convolving the two mixture marginals.
