G-Computation
Use the synthetic data setup first; it defines data and the columns used below. These are advanced direct R examples.
Average model-predicted outcomes under specified exposure contrasts.
gcomp_result <- causal_gcomp(data, "Immunotherapy", "Response",
confounders = c("Age", "Sex", "Stage", "ECOG"),
outcome_type = "binary",
boot_R = 500)Read the result
Binary-outcome contrasts can include RiskDiff, RiskRatio and MarginalOR. Keep the requested exposure contrast and bootstrap settings. Eligible survival paths target RMST or survival-probability differences, not a hazard ratio.
See effect scales and reporting, diagnostics and the current support reference.