Skip to contents

Validates and constructs a candidate set for sda_fit without fitting. Returns an auditable plan object that records which columns were accepted, which were excluded and why, and what settings would be passed to sda_fit().

Usage

auto_sda_plan(
  data,
  outcome,
  candidates = NULL,
  exclude = NULL,
  role_map = NULL,
  time_map = NULL,
  stage_map = NULL,
  attr_types = NULL,
  collinearity_threshold = 1,
  min_n = NULL,
  min_class_n = NULL,
  mode = c("unioda_max_ess", "novometric_min_d"),
  dry_run = TRUE
)

Arguments

data

A data frame.

outcome

Character scalar: name of the binary outcome column in data.

candidates

Character vector of candidate column names, or NULL (default) to use all non-outcome columns after exclusions.

exclude

Character vector of column names to force-exclude from candidates regardless of other checks.

role_map

Named list mapping column names to declared roles: "assignment_mechanism", "outcome", "id", or "leakage". Columns declared as "id" or "leakage" are excluded from the candidate set.

time_map

Named numeric/integer vector mapping column names to time indices. Columns with time_map value greater than the outcome's time index generate a warning flagging potential leakage. Temporal validity is a scientific judgment; auto_sda_plan flags but does not auto-exclude on this basis.

stage_map

Named integer vector mapping column names to stage assignments. Stored for downstream use; not used for exclusions.

attr_types

Named character vector mapping column names to declared attribute types ("ordered", "categorical", "binary"). Overrides type inference for named columns.

collinearity_threshold

Numeric threshold for collinearity detection. Default 1.0 detects exact-duplicate columns only.

min_n

Passed through to proposed_call for sda_fit().

min_class_n

Passed through to proposed_call.

mode

SDA mode: "unioda_max_ess" (legacy/iterative UniODA) or "novometric_min_d" (MPE-canon; per-attribute MDSA via cta_descendant_family(); requires mindenom).

dry_run

Logical. Must be TRUE (default). Fitting is not performed in SDA-3; dry_run = FALSE errors.

Value

Object of class c("auto_sda_plan", "odacore_plan").

Details

Agent principle: auto_sda_plan() proposes and validates. It does not silently decide causal validity, temporal ordering, exposure roles, or outcome roles. If temporal or causal structure is required, declare it via role_map, time_map, or stage_map.