% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/methods_post_estimation.R
\name{conditional_effects}
\alias{conditional_effects}
\title{Calculate Conditional Effects}
\usage{
conditional_effects(fit, effect, prob = 0.95, sd_multiplier = 1, ...)
}
\arguments{
\item{fit}{Model fit object (e.g., `mcmc_fit`, `map_fit`).}

\item{effect}{Name of the variable to visualize (e.g., "X1" or "X1:X2").}

\item{prob}{Probability for the credible/confidence interval (default is 0.95).}

\item{sd_multiplier}{Numeric. Multiplier for standard deviation when splitting continuous moderators (default is 1).}

\item{...}{Additional arguments.}
}
\value{
An object of class `ce_rtmb` containing the predicted values and their credible intervals.
}
\description{
Calculate and visualize the predicted values (marginal effects) of a variable,
potentially conditional on the levels of another variable (interaction).
}
\examples{
\donttest{
  data(debate, package = "BayesRTMB")
  fit <- rtmb_lm(sat ~ talk * perf, data = debate)
  map_fit <- fit$optimize()
  ce <- conditional_effects(map_fit, effect = "talk:perf")
  plot(ce)
  summary(ce)
}
}
