% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/compare_models.R
\name{compare_models}
\alias{compare_models}
\title{Compare Moderation Models}
\usage{
compare_models(object, models = NULL, corrected = TRUE)
}
\arguments{
\item{object}{A "modlr" object}

\item{models}{Optional numeric vector specifying which models to compare.
If NULL (default), all candidate models are evaluated.}

\item{corrected}{Logical; whether to use AICc}
}
\value{
A data frame with model comparison results
}
\description{
Compares candidate moderation models using information criteria (AIC/AICc).
}
\examples{
set.seed(123)

n <- 100
x <- rnorm(n)
z <- 0.5 * x + sqrt(1 - 0.5^2) * rnorm(n)

y <- 0.3 * x + 0.3 * z + 0.8 * x * z + rnorm(n)

data <- data.frame(x, z, y)

result <- moderated_regression(data, iv = "x", moderator = "z", dv = "y")

compare_models(result)
compare_models(result, models = c(1, 2))

}
