Identifies rows with missing values in `y` (and `zcol` if supplied), applies the chosen `na.action` strategy, and returns the complete-case subsets of the outcome vector, covariate matrix, and pseudo-weight vector. Also standardizes the domain variable via `standardize_zcol()`.
process_na_yz(sc_data, y, zcol = NULL, na.action = stats::na.omit)A list with components:
- `Y`: numeric outcome vector (complete cases only). - `X`: covariate matrix (complete cases only). - `w`: pseudo-weight vector (complete cases only). - `sc`: data frame (complete cases only). - `y_name`: the value of `y`. - `zcol`: the value of `zcol`. - `domain`: list returned by `standardize_zcol()`. - `na_info`: list with `na_action`, `n_omitted`, `n_used`, `omitted_raw`, and `kept_raw`.
A list returned by `prepare_sc_data()`, with components `sc`, `X`, `w`, and `idx_keep`.
Single character string naming the outcome variable in `sc_data$sc`.
Single character string naming the domain variable in `sc_data$sc`, or NULL for the overall mean.
NA-handling function; one of `stats::na.omit` (default), `stats::na.exclude`, or `stats::na.fail`. `na.pass` is not supported.