Process NA for `est_pw()` before estimation step. Resolves the `na.action` argument to a standard mode string, applies NA filtering to `sc` and `sp`, subsets the survey design object(s) in `sp_des` to match the filtered `sp`, and produces a summary of exclusions.
process_na_build(sc, sp, sp_des, p_formula, na.action, n_ref, verbose = FALSE)A list with the following elements:
Character string: one of `"omit"`, `"exclude"`, `"fail"`, or `"pass"`.
The cleaned nonprobability sample data frame.
The cleaned reference survey data frame(s).
The subsetted survey design object(s).
Logical vector indicating which rows of the original `sc` are retained.
Logical vector (one-reference) or list of logical vectors (multi-reference) indicating which rows of each `sp` are retained.
Original row count(s) of `sp_des` before subsetting.
An lm-style `na.action` attribute for `sc`, or `NULL` if no rows were removed.
Character vector of per-variable NA detail messages from `handle_na_for_ipwm()`, suitable for appending to the running `log_messages` in `est_pw()`.
A `pw_na_summary` object with row counts before and after NA removal, or `NULL` if no rows were excluded.
A data frame. The nonprobability sample (before NA removal).
A data frame (one-reference case) or a named list of data frames (multi-reference case). Analysis data extracted from the reference survey design(s).
A single survey design object (one-reference case) or a named list of survey design objects (multi-reference case). Subsetted to align with the filtered `sp`.
A one-sided formula (one-reference case) or a list of one-sided formulas (multi-reference case) specifying the participation model variables used to identify rows with missing values.
A function (`stats::na.omit`, `stats::na.exclude`, `stats::na.fail`, or `stats::na.pass`), an equivalent character string, or `NULL` (which inherits from `getOption("na.action")`).
Integer. Number of reference surveys. Controls whether one-reference or multi-reference logic is applied when subsetting `sp_des` and computing `n_sp_orig`.
Logical. If `TRUE`, prints per-dataset row counts and exclusion totals via `message()`.