Specify a target trial protocol

Description

Creates a structured description of the target trial that your causal analysis emulates. This is a documentation aid — the object is not passed to causat() or contrast(). It helps you reason through the components of the target trial (Hernán & Robins 2025, Ch. 22) before writing the analysis code.

Usage

target_trial(
  eligibility = NULL,
  treatment_strategy = NULL,
  assignment = NULL,
  follow_up = NULL,
  outcome = NULL,
  causal_contrast = NULL,
  model = NULL,
  censoring = NULL
)

Arguments

eligibility Character. Who is eligible for the trial at time zero?
treatment_strategy Character. What treatment strategies are compared? (e.g. "initiate treatment A vs. remain untreated")
assignment Character. How are individuals assigned to strategies? (e.g. "random assignment at baseline")
follow_up Character. When does follow-up start and end?
outcome Character. What outcome is measured, and when?
causal_contrast Character. What causal contrast is estimated? (e.g. "intention-to-treat effect", "per-protocol effect")
model Character. What statistical model links the data to the causal parameter? (e.g. "parametric g-formula with logistic outcome model")
censoring Character. How is loss to follow-up or non-adherence handled? (e.g. "IPCW for dropout", "grace period of 2 visits")

Value

A causatr_target_trial object (S3 list with a print method).

See Also

causat(), contrast()

Examples

library("causatr")

target_trial(
  eligibility = "Adults aged 25-74 who smoke >= 5 cig/day",
  treatment_strategy = "Quit smoking vs. continue smoking",
  follow_up = "Baseline (1971) to end of follow-up (1982)",
  outcome = "Weight change in kg at end of follow-up",
  causal_contrast = "ATE: E[Y(quit)] - E[Y(continue)]"
)