Skip to contents

Trial-specific subgroup effects reconstructed at each trial's own information fraction \(\pi_j\) (the same estimand as the observed black squares on forestplot()). The two latent components, combined coordinate \(m_j=(1-\pi_j)y_{Aj}+\pi_j y_{Bj}\) and contrast \(g_j=y_{Bj}-y_{Aj}\), are shrunk (\(\widetilde m_j\), \(\widetilde g_j\)) and then inverted: $$\widetilde\mu_{Aj}=\widetilde m_j-\pi_j\widetilde g_j,\qquad \widetilde\mu_{Bj}=\widetilde m_j+(1-\pi_j)\widetilde g_j.$$ These identities hold draw by draw on the model scale; exponentiation (if requested) happens only afterwards. A grey forest marker therefore need not lie between the quoted estimate and the subgroup pooled diamond.

Usage

shrinkage(
  fit,
  type = c("modifiers", "interaction", "combined", "subgroups"),
  format = c("list", "summary"),
  prob = 0.95,
  max_support = NULL,
  summary = TRUE,
  contrast_sep = "-",
  ifrac = "interaction",
  at_ifrac = NULL,
  at = NULL,
  exponentiate = FALSE,
  component = NULL,
  contribution = NULL,
  reference = NULL
)

Arguments

fit

A interactmeta from cams().

type

Which estimand (same labels as forestplot()):

  • "modifiers" (default; "subgroup" / deprecated "subgroups" accepted): \(\mu_{A,j}, \mu_{B,j}\)

  • "interaction": \(g_j\)

  • "combined": \(m_j\)

format

Output representation:

  • "list" (default): S3 object with long $support, optional $summary, and $components (observed / shrunk matrices)

  • "summary": summary data frame only

prob

Coverage probability for intervals when a summary is built.

max_support

Optional cap on unweighted posterior rows. Rejected for Bayesian CAMS DIRECT supports; omit it.

summary

If TRUE (default), attach / build a summary when format = "list" or "summary".

contrast_sep

Passed to contrast resolution (default "-").

ifrac

How the reporting IF \(\omega\) is pooled via ifrac() when at_ifrac is NULL (metadata / annotations only for shrinkage; draws themselves use \(\pi_j\)): "interaction" (default) or "combined".

at_ifrac

Combined-population reporting information fraction (\(\pi^\star\)). If NULL (default), pools via ifrac() with ifrac (default "interaction"). Use at_ifrac = "interaction" or "combined" for the same. A scalar in [0, 1] is a plug-in; a numeric vector (one value per support row) assigns different \(\pi^\star\) to each inner mixture node (unusual). To average over a distribution of \(\pi^\star\) (outer draws \(\times\) inner nrow(fit$support) grid), use reporting_if_draws() as at_ifrac, e.g. at_ifrac = reporting_if_draws(1000, shape1 = 5, shape2 = 7). REML / ML: pooled modes or a scalar only.

at

Deprecated alias of at_ifrac.

exponentiate

If TRUE, transform posterior draws with exp() after the linear-scale reconstruction (for reporting only).

component

Soft-deprecated alias for type.

contribution

Deprecated; use at_ifrac.

reference

Optional label of the reference subgroup (A) to report against. NULL (default) keeps the reference used in cams(). Naming the stored non-reference subgroup re-expresses the existing fit without refitting (two subgroups only): information fractions become \(1-\pi\) (trial \(\pi_j\), pooled \(\omega\), and at_ifrac, which is read on the requested orientation), interactions change sign (\(g_j \rightarrow -g_j\), \(\gamma \rightarrow -\gamma\)) and contrast labels swap; modifier-level and combined-population effects are unchanged. Frequentist (REML / ML) results equal a refit with cams(..., reference = ). Bayesian results can differ slightly from such a refit because the default normal prior on \((\alpha,\beta_m)\) is not invariant to this reparameterization.

Value

For format = "list", an effects object of the same class as modifiers(), interactions(), or combined() (by type) whose support / summary rows have type = "Shrinkage" and one row per trial (and level or interaction); summary columns are as in modifiers(). $components holds the observed and shrunk inputs (see shrinkage_components()). For format = "summary", the summary data frame only.

Details

Engine-native trial effects:

  • bayesmeta: DIRECT individual / shrinkage posteriors for \(\widetilde m_j\) and \(\widetilde g_j\) (bmr$shrink.moments / bayesmeta$cond.moment(individual=)), combined across blocks at each trial's fixed design \(\pi_j\) (product of mixture nodes; see cams() Method). Optional fit$latent$mu_A / $mu_B mirror this reconstruction when the latent is materialized.

  • metafor: empirical-Bayes BLUPs of the orthogonal overall and interaction blocks, then the same reconstruction.

This is not the fixed-effect linear predictor at \(\pi_j\). fitted() returns that FE mean (fit$mu); shrinkage() is the trial-level reconstruction the forest greys use. Overall / Prediction use the pooled reporting IF \(\omega\); see modifiers() and standardized_trial_effects().