% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ild_joint_msm_weights.R
\name{ild_joint_msm_weights}
\alias{ild_joint_msm_weights}
\title{Joint MSM weights from IPTW and IPCW components}
\usage{
ild_joint_msm_weights(
  x,
  stabilize = c("mean1", "none"),
  trim = c(0.01, 0.99),
  joint_name = ".ipw"
)
}
\arguments{
\item{x}{An ILD object containing \code{.ipw_treat} and \code{.ipw_censor}
(from [ild_iptw_weights()] or [ild_iptw_msm_weights()], and [ild_ipcw_weights()]).}

\item{stabilize}{Character. \code{"none"}: \code{w_treat * w_censor} only.
\code{"mean1"} (default): divide joint weights by their mean so the mean is 1
(helps comparability with stabilized components).}

\item{trim}{Numeric of length 2. Quantiles for trimming the **joint** vector
(default \code{c(0.01, 0.99)}).}

\item{joint_name}{Character. Name of the combined weight column (default \code{".ipw"}).}
}
\value{
\code{x} with \code{joint_name} set; component columns unchanged.
}
\description{
Multiplies \code{.ipw_treat} and \code{.ipw_censor} into a single analysis
weight column (default \code{.ipw}) for use with [ild_ipw_refit()] and
[ild_diagnose()]. Optional scaling sets the mean joint weight to 1.
}
\section{Bundle integration}{

Sets \code{.ipw} (or \code{joint_name}) so existing causal diagnostics and
guardrails apply to the **joint** weight.
}

\examples{
set.seed(4)
d <- ild_simulate(n_id = 15, n_obs_per = 8, seed = 4)
d$stress <- rnorm(nrow(d))
d$trt <- as.integer(d$stress > 0)
x <- ild_prepare(d, id = "id", time = "time")
x <- ild_iptw_weights(x, "trt", "stress")
x <- ild_ipcw_weights(x, "stress")
x <- ild_joint_msm_weights(x)
summary(x$.ipw)
}
\seealso{
[ild_iptw_weights()], [ild_iptw_msm_weights()], [ild_ipcw_weights()], [ild_ipw_refit()]

Other ild_diagnostics_utilities: 
\code{\link{ild_design_check}()},
\code{\link{ild_ipcw_weights}()},
\code{\link{ild_iptw_msm_weights}()},
\code{\link{ild_iptw_weights}()},
\code{\link{ild_ipw_weights}()},
\code{\link{ild_missing_cohort}()},
\code{\link{ild_missing_compliance}()},
\code{\link{ild_missing_hazard_first}()},
\code{\link{ild_missing_model}()},
\code{\link{ild_missing_pattern}()},
\code{\link{ild_missingness_report}()}
}
\concept{ild_diagnostics_utilities}
