% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_maihda.R
\name{plot.maihda_model}
\alias{plot.maihda_model}
\title{Plot MAIHDA Model Results}
\usage{
\method{plot}{maihda_model}(
  x,
  type = c("all", "vpc", "obs_vs_shrunken", "predicted", "risk_vs_effect",
    "effect_decomp", "ternary", "prediction_deviation"),
  summary_obj = NULL,
  n_strata = 50,
  ...
)
}
\arguments{
\item{x}{A maihda_model object from \code{fit_maihda()}.}

\item{type}{Character string specifying plot type:
\itemize{
  \item "vpc": Variance partition coefficient visualization
  \item "obs_vs_shrunken": Observed vs. shrunken stratum means
  \item "predicted": Predicted values for each stratum with confidence intervals
  \item "risk_vs_effect": Quadrant scatterplot comparing overall risk to intersectional effect
  \item "effect_decomp": Visualizes additive vs intersectional deviation from global mean
  \item "ternary": Ternary plot analyzing the dimensional breakdown of variance
  \item "prediction_deviation": Detailed deviation panels for individuals or strata
  \item "all": Generate all available plots (default if not specified)
}}

\item{summary_obj}{Optional maihda_summary object from \code{summary()}.
If NULL, will be computed.}

\item{n_strata}{Maximum number of strata to display in predicted plot.
Default is 50. Use NULL for all strata.}

\item{...}{Additional arguments (not currently used).}
}
\value{
A ggplot2 object, or a list of ggplot2 objects if type = "all".
}
\description{
Creates various plots for visualizing MAIHDA model results including
variance partition coefficient comparisons, observed vs. shrunken estimates,
and predicted subgroup values with confidence intervals.
}
\examples{
\donttest{
strata_result <- make_strata(maihda_sim_data, vars = c("gender", "race"))
model <- fit_maihda(health_outcome ~ age + (1 | stratum), data = strata_result$data)

# VPC plot
plot(model, type = "vpc")

# Generate all plots
plots <- plot(model)
}

}
