% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/predict.R
\name{marginal_effects}
\alias{marginal_effects}
\title{Marginal treatment effects}
\usage{
marginal_effects(
  object,
  population = c("both", "index", "comparator"),
  effect = "all",
  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{effect}{Which effect measure. For binomial: \code{"all"}, \code{"lor"}, \code{"rd"},
or \code{"rr"}. For normal: \code{"all"} or \code{"md"} (mean difference). For poisson:
\code{"all"} or \code{"rr"} (rate ratio).}

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

\item{probs}{Quantiles for summary}
}
\value{
A data frame
}
\description{
Extract marginal treatment effects from a fitted ML-UMR model. For
binomial: log odds ratio, risk difference, risk ratio. For normal:
mean difference. For poisson: rate ratio.
}
\examples{
\dontrun{
# All effect measures for both populations
marginal_effects(fit)

# Only the log odds ratio in the index population
marginal_effects(fit, population = "index", effect = "lor")

# Full posterior draws rather than summary statistics
marginal_effects(fit, summary = FALSE)
}
}
\seealso{
\code{\link[=predict.mlumr_fit]{predict.mlumr_fit()}} for absolute predictions;
\code{\link[=conditional_effects]{conditional_effects()}} for covariate-conditional effects at specific
profiles; \code{\link[=prior_sensitivity]{prior_sensitivity()}} to check how strongly the marginal
effect depends on \code{prior_beta}.
}
