
CAMS subgroup and overall effects on an information-fraction grid
Source:R/contribution.R
predict_cams_by_if.RdEvaluates the fitted CAMS posterior at a grid of information fractions
without refitting. Each posterior row already stores the joint pairing of
\((\alpha,\theta)\) (overall block) with the independent interaction
draw \(\gamma\). For draw \(s\) and grid value \(\pi_k\):
$$M^{(s)}(\pi_k)=\alpha^{(s)}+\theta^{(s)}\pi_k,$$
$$\mu_A^{(s)}(\pi_k)=M^{(s)}(\pi_k)-\pi_k\gamma^{(s)},$$
$$\mu_B^{(s)}(\pi_k)=M^{(s)}(\pi_k)+(1-\pi_k)\gamma^{(s)}.$$
Stored b_Intercept is \(\alpha\), stored b_ifrac is
\(\beta=\theta-\gamma\), and stored b_subgroup* is \(\gamma\), so
\(\theta=\beta+\gamma\). Subgroup lines are parallel with vertical
gap \(\gamma\).
Usage
predict_cams_by_if(
fit,
if_grid = NULL,
level = 0.95,
ifrac_var = NULL,
resolution = 200,
max_support = NULL,
exponentiate = FALSE,
interval.type = NULL
)Arguments
- fit
A
interactmetafromcams().- if_grid
Numeric information-fraction grid. If
NULL, spans the observed study IF range with a small margin (seeplot_contribution()).- level
Coverage probability for
lower/upper(default0.95).- ifrac_var
ifrac_*column used to build the default grid.- resolution
Grid length when
if_gridisNULL.- max_support
Optional cap on unweighted posterior rows. Rejected for Bayesian CAMS DIRECT supports; omit it.
- exponentiate
If
TRUE, summarize on the exponential scale.- interval.type
"central"or"shortest"mixture interval on Bayesian DIRECT nodes (default:fit$interval.type, usually"central"). Pass"shortest"for the narrowest equal-probability interval.
Value
A data frame with one row per grid point and subgroup:
ifrac, subgroup, estimate, lower, upper, plus
overall_estimate, overall_lower, overall_upper for
\(M(\pi)=\alpha+\theta\pi\) at that grid point.
Details
Pointwise estimate / lower / upper use mixture intervals from the
DIRECT-node Gaussian mixture (weights .weight, within-node SDs
.cond_*). Alpha and theta stay on the joint overall-block support
(never convolved with each other).