% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/predict.R
\name{predict.mlumr_fit}
\alias{predict.mlumr_fit}
\title{Predictions from ML-UMR model}
\usage{
\method{predict}{mlumr_fit}(
  object,
  population = c("both", "index", "comparator"),
  type = c("response", "link"),
  summary = TRUE,
  probs = c(0.025, 0.5, 0.975),
  ...
)
}
\arguments{
\item{object}{An \code{mlumr_fit} object}

\item{population}{Which population: \code{"both"}, \code{"index"}, or \code{"comparator"}}

\item{type}{Prediction type: \code{"response"} or \code{"link"}. For \code{"response"}:
probabilities (binomial), means (normal), or rates (poisson). For
\code{"link"}: mean linear predictor on the fitted link scale (logit, probit,
cloglog, log, or identity). The link-scale values are computed directly
from parameter draws as \code{E[eta]}, not as \code{link(E[g^{-1}(eta)])}, to
avoid Jensen's inequality bias.}

\item{summary}{Return summary statistics (\code{TRUE}) or full posterior draws (\code{FALSE})}

\item{probs}{Quantiles for summary (default \code{c(0.025, 0.5, 0.975)})}

\item{...}{Additional arguments (unused)}
}
\value{
A data frame with predictions. When \code{type = "link"}, values are
mean linear predictors computed directly from parameter draws (avoiding
Jensen's inequality bias).
}
\description{
Generate population-average absolute-outcome predictions in the index and
comparator populations.
}
\details{
\strong{Marginalization on non-identity links.} For \code{type = "response"} the
reported values are \code{E[g^{-1}(eta)]} — the posterior expectation of the
inverse-link-transformed linear predictor — \emph{not} \code{g^{-1}(E[eta])}. The
two differ whenever \code{g} is non-linear (logit, probit, cloglog, log) by
Jensen's inequality. In the index population the expectation is taken
over IPD individuals; in the comparator population it is taken over the
integration points constructed by \code{\link[=add_integration]{add_integration()}} from the AgD
moments. This is the correct population-average prediction for an
individual randomly drawn from that population, and it matches what the
Stan \verb{generated quantities} block computes. For the link scale
(\code{type = "link"}) the reported value is \code{E[eta]}, a linear functional,
and the two interpretations coincide.
}
\seealso{
\code{\link[=marginal_effects]{marginal_effects()}} for treatment-effect summaries;
\code{\link[=conditional_predict]{conditional_predict()}} and \code{\link[=conditional_effects]{conditional_effects()}} for predictions
at specific covariate profiles.
}
