% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/compare_maihda.R
\name{compare_maihda}
\alias{compare_maihda}
\title{Compare MAIHDA Models}
\usage{
compare_maihda(
  ...,
  model_names = NULL,
  bootstrap = FALSE,
  n_boot = 1000,
  conf_level = 0.95
)
}
\arguments{
\item{...}{Multiple maihda_model objects to compare.}

\item{model_names}{Optional character vector of names for the models.}

\item{bootstrap}{Logical indicating whether to compute bootstrap confidence
intervals. Default is FALSE.}

\item{n_boot}{Number of bootstrap samples if bootstrap = TRUE. Default is 1000.}

\item{conf_level}{Confidence level for bootstrap intervals. Default is 0.95.}
}
\value{
A data frame comparing VPC/ICC across models with optional confidence intervals.
}
\description{
Compares variance partition coefficients (VPC/ICC) across multiple MAIHDA models,
with optional bootstrap confidence intervals.
}
\examples{
\donttest{
# Create strata and models using simulated data
strata_1 <- make_strata(maihda_sim_data, vars = c("gender", "race"))
strata_2 <- make_strata(maihda_sim_data, vars = c("gender", "race", "education"))

model1 <- fit_maihda(health_outcome ~ age + (1 | stratum), data = strata_1$data)
model2 <- fit_maihda(health_outcome ~ age + gender + (1 | stratum), data = strata_2$data)

# Compare without bootstrap
comparison <- compare_maihda(model1, model2,
                            model_names = c("Base", "With Gender"))

# Compare with bootstrap CI
comparison_boot <- compare_maihda(model1, model2,
                                 model_names = c("Base", "With Gender"),
                                 bootstrap = TRUE, n_boot = 500)
}

}
