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

\item{effect}{Character string of the interaction (e.g., "A:B"). The first variable is the focal variable.}

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

\item{sd_multiplier}{Multiplier for SD for continuous moderators (default is 1).}

\item{...}{Additional arguments.}
}
\value{
A `ce_simple` object (data frame) containing the estimated effects and their credible intervals.
}
\description{
Calculate the effect of a focal variable at different levels of a moderator.
For categorical focal variables, it calculates pairwise differences (contrasts).
For continuous focal variables, it calculates the slope (simple slopes).
}
\examples{
\donttest{
  data(debate, package = "BayesRTMB")
  fit <- rtmb_lm(sat ~ talk * perf, data = debate)
  map_fit <- fit$optimize()
  # Effect of talk at different levels of performance
  se <- simple_effects(map_fit, effect = "talk:perf")
  print(se)
}
}
