Converts `zcol` in `data` to a standard form used throughout the estimation pipeline. Logical and binary numeric (0/1) variables become a single integer indicator column; character variables are trimmed and coerced to a factor; factor variables are dropped of unused levels and expanded to one integer indicator column per level. The returned list always has the same structure so downstream code can branch on `mode` alone.
standardize_zcol(data, zcol = NULL)A list with components:
- `mode`: one of `"overall"`, `"binary"`, or `"factor"`. - `z_name`: the value of `zcol`, or NULL when `zcol` is NULL. - `labels`: character vector of domain labels shown to the user. - `indicators`: data frame of integer 0/1 indicator columns (one column per domain level), or NULL in the overall case.
A data frame containing the column named by `zcol`.
Single character string naming the domain variable in `data`, or NULL for the overall (no-domain) case.