% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ild_msm_balance.R
\name{ild_msm_overlap_plot}
\alias{ild_msm_overlap_plot}
\title{Propensity overlap plot (pooled or sequential MSM IPTW)}
\usage{
ild_msm_overlap_plot(data, treatment, source = c("auto", "pooled", "msm"))
}
\arguments{
\item{data}{ILD with treatment column and relevant \code{glm} attributes.}

\item{treatment}{Binary treatment column name.}

\item{source}{Character: \code{"auto"} (prefer MSM fits if present), \code{"pooled"}, or
\code{"msm"}.}
}
\value{
A \code{ggplot} object.
}
\description{
For **pooled** [ild_iptw_weights()], uses \code{attr(data, "ild_iptw_fit")} and plots the
distribution of fitted \eqn{P(A=1\mid L)} by treatment level.
}
\details{
For **sequential** [ild_iptw_msm_weights()], uses \code{attr(data, "ild_iptw_msm_fits")} and
facets by occasion: fitted denominator propensity at each \eqn{t}.
}
\examples{
if (requireNamespace("ggplot2", quietly = TRUE)) {
  set.seed(3)
  d <- ild_simulate(n_id = 15, n_obs_per = 5, seed = 3)
  d$stress <- rnorm(nrow(d))
  d$trt <- as.integer(stats::rbinom(nrow(d), 1L, 0.45))
  x <- ild_prepare(d, id = "id", time = "time")
  x <- ild_iptw_weights(x, treatment = "trt", predictors = "stress")
  ild_msm_overlap_plot(x, treatment = "trt", source = "pooled")
}
}
