Generate population-average absolute-outcome predictions in the index and comparator populations.
Arguments
- object
An
mlumr_fitobject- population
Which population:
"both","index", or"comparator"- type
Prediction type. For binomial/normal/poisson:
"response"(default) or"link". For survival:"survival"(default),"hazard","cumhaz","rmst"(restricted mean survival time),"median"(median survival, obtained by linear interpolation on the fittedpred_timesgrid; if the true median precedes the first grid point it is interpolated between the known exact pointS(0) = 1and(pred_times[1], S(pred_times[1])), so it is never reported as later than the first grid time, though a denserpred_timesnear zero still resolves very early medians better), or"loghr"(time-varying marginal log hazard ratio of index vs comparator at each fitted time, per population). For"response": probabilities (binomial), means (normal), or rates (poisson). For"link": the fitted link applied to the population-standardized response mean,g(E[g^{-1}(eta)]). This is the marginal link-scale prediction used by G-computation; it is generally not the mean conditional linear predictorE[eta].- summary
Return summary statistics (
TRUE) or full posterior draws (FALSE)- probs
Quantiles for summary (default
c(0.025, 0.5, 0.975))- times
For survival fits, an optional vector of times at which to report curve predictions; each is matched to the nearest fitted
pred_timesgrid point. IfNULL, all fitted times are returned.When supplied, the result has one row per requested time for each treatment and population cell, in the order requested and including repeats, with a
requested_timecolumn besidetime. Withsummary = FALSEthe mapping is carried as therequested_timeandused_timeattributes instead, one entry per time column. Refit withpred_timescontaining the exact times to avoid the approximation.- newdata
Optional data frame of covariate profiles defining an arbitrary target population. When supplied, per-treatment absolute predictions are standardized to this population by g-computation (averaging model-based predictions over the rows at each posterior draw), and
populationis ignored. Supportstype = "response"/"link"(binomial/normal/poisson) andtype = "survival"/"hazard"/"cumhaz"/"rmst"/"median"/"loghr"(survival). Rows outside the fitted covariate support are model-based extrapolation; overlap is not checked.- ...
Additional arguments (unused)
Value
A data frame with predictions. type = "rmst" adds a horizon
column with the restriction time actually integrated to, since RMST at
different horizons is a different estimand. The plot methods require
summary = TRUE; with summary = FALSE the raw posterior draws are
returned as a plain data frame. For type = "median" the summary is
conditional on the median being reached, and p_not_reached gives the
posterior probability that it is not.
Details
Marginalization on non-identity links. For type = "response" the
reported values are E[g^{-1}(eta)], the population-average prediction
for an individual drawn from that population, not g^{-1}(E[eta]); the
expectation runs over the IPD individuals for the index population and
over the integration points for the comparator one. type = "link"
applies the fitted link after that marginalization.
See also
marginal_effects() for treatment-effect summaries;
conditional_predict() and conditional_effects() for predictions
at specific covariate profiles.