Mapping: Identify variables and analysis times for PDRobust

View source: R/Mapping.R

MappingR Documentation

Identify variables and analysis times for PDRobust

Description

Records which columns contain the subject ID, time, treatment, survival, outcome, and covariates, together with the analysis time range and outcome type. Other package functions use this information to interpret the data consistently.

Usage

Mapping(
  id,
  time,
  treatment,
  survival,
  outcome,
  baseline_time,
  cutoff_time,
  covariates,
  interest_vars,
  y_type
)

Arguments

id

A single character string naming the subject ID column.

time

A single character string naming the time column.

treatment

A single character string naming the treatment column. For causal estimation, code the survival-favorable arm as 1 and the other arm as 0; see PDRobust-package for the convention and assumptions. The function does not determine which arm is survival-favorable.

survival

A single character string naming the column that records survival or another intermediate status.

outcome

A single character string naming the outcome column.

baseline_time

A single finite number giving the baseline time in the original time scale.

cutoff_time

The time point, on the original time scale, at which the always-survivor principal stratum is defined.

covariates

A character vector naming all variables used as predictors in the propensity score, principal score, or outcome mean models.

interest_vars

A character vector specifying the names of variables used to evaluate heterogeneous treatment effects. Each variable must also be included in covariates.

y_type

The outcome type: "C" for continuous or "B" for binary.

Details

All ten arguments are required. target_time is specified separately when calling HTESepT() because it selects time points for that analysis rather than describing the data.

Value

A pd_mapping object that can be supplied to DataCheck() and DataStandard().

Examples

map <- Mapping(
  id = "id", time = "time", treatment = "A",
  survival = "S", outcome = "Y",
  baseline_time = 3,
  cutoff_time = 9,
  covariates = c("X1", "X2", "X4"),
  interest_vars = c("X1", "X2"),
  y_type = "C"
)
map

PDRobust documentation built on Oct. 2, 2026, 5:09 p.m.