% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/compare_models.R
\name{compare_models}
\alias{compare_models}
\title{Compare Multiple Nested or Non-Nested Structural Equation Models}
\usage{
compare_models(
  model_list,
  data,
  estimator = "ML",
  se = "standard",
  bootstrap = 1000,
  parallel = "no",
  verbose = TRUE,
  ...
)
}
\arguments{
\item{model_list}{A named list. Each element is a character string
specifying the model syntax in lavaan format.}

\item{data}{A data.frame containing the observed variables used in
the models.}

\item{estimator}{The estimator to be used (e.g., "ML"). Passed to
\code{\link[lavaan]{sem}}.}

\item{se}{Type of standard errors. Default is "standard". Use
"bootstrap" for bootstrapped standard errors and confidence intervals.}

\item{bootstrap}{Number of bootstrap draws if
\code{se="bootstrap"}. Default is 1000.}

\item{parallel}{Method for parallel processing for bootstrapping
("multicore", "snow", or "no"). Recommended for large samples.}

\item{verbose}{Logical; if TRUE, progress messages are printed.}

\item{...}{Additional arguments passed to
\code{\link[lavaan]{sem}}.}
}
\value{
An object of class \code{modelscompete4}. This is a list
  containing:
  \itemize{
    \item \code{fit_list}: The list of fitted lavaan objects.
    \item \code{fit_table}: A data.frame of key fit indices for all
      models.
    \item \code{comparison_matrix}: A matrix showing pairwise nesting
      relationships and test results.
    \item \code{test_results}: Detailed results of the statistical
      tests performed.
    \item \code{bootstrap_summary}: Summary of bootstrapped results if
      requested.
  }
}
\description{
This is the core function of the modelscompete4
  package. It automatically fits a list of SEM models, determines their
  nesting relationship, and performs the appropriate statistical
  comparison (chi-square difference test for nested models, Vuong test for
  non-nested models).
}
