% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/stc.R
\name{stc}
\alias{stc}
\title{Simulated treatment comparison via G-computation}
\usage{
stc(data, link = NULL, conf_level = 0.95)
}
\arguments{
\item{data}{An \code{mlumr_data} object from \code{\link[=combine_data]{combine_data()}}. Integration points
are not required for STC but covariate information from the AgD is used.}

\item{link}{Link function. For binomial: \code{"logit"} (default), \code{"probit"},
or \code{"cloglog"}. For normal: \code{"identity"} (default) or \code{"log"}. For
poisson: \code{"log"} (default). If \code{NULL}, uses the canonical default.}

\item{conf_level}{Confidence level for the interval (default 0.95)}
}
\value{
An object of class \code{mlumr_stc}
}
\description{
Perform an unanchored simulated treatment comparison (STC) using parametric
G-computation. Fits a regression on IPD, predicts counterfactual
outcomes in both the index and comparator populations, and computes
marginal treatment effects with delta-method standard errors.
}
\details{
For binomial outcomes, returns the treatment effect on the link scale plus
event probabilities, risk difference, and log risk ratio with SEs and CIs
for both populations. Event-probability intervals use Wald standard errors
and are bounded to \verb{[0, 1]}. For Poisson outcomes, the comparator log rate
uses a 0.5 continuity correction when the observed event count is zero.

The STC procedure is:
\enumerate{
\item Fit a GLM on IPD (binomial/gaussian/poisson as appropriate).
\item Predict on comparator-population covariates (from integration points or
AgD covariate means).
\item Marginalize predictions over the comparator population.
\item Predict on index-population covariates (IPD).
\item Compute treatment effects and SEs via the delta method.
}

STC is a parametric G-computation benchmark. It relies on the IPD outcome
model being correctly specified and transportable to the comparator
population. It does not model posterior uncertainty in population
covariate distributions or relax treatment-specific covariate effects.
When clinically meaningful effect modification is plausible, prefer
\code{mlumr(..., model = "relaxed")} as the primary analysis and use STC as a
sensitivity or benchmarking analysis.

For binomial outcomes, the comparator-population treatment contrast is
transported to the index population \strong{assuming the treatment contrast is
constant on the fitted link scale} (i.e., no effect modification on that
scale). Under this assumption, the index-population comparator
probability is computed as
\code{inv_link(link(p_A_index) - (link(p_A_comp) - link(p_B)))}, and its
uncertainty is propagated through the delta method. If effect modification
is expected, fit a Bayesian relaxed model with
\code{mlumr(..., model = "relaxed")} and use \code{predict(..., population = "index")} instead, which does not require this assumption.
}
\examples{
\dontrun{
result <- stc(dat)
print(result)
}
}
