% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pwmean_s3_process_na.R
\name{process_na_yz}
\alias{process_na_yz}
\title{Handle missing values in the outcome and domain variables}
\usage{
process_na_yz(sc_data, y, zcol = NULL, na.action = stats::na.omit)
}
\arguments{
\item{sc_data}{A list returned by `prepare_sc_data()`, with components
`sc`, `X`, `w`, and `idx_keep`.}

\item{y}{Single character string naming the outcome variable in `sc_data$sc`.}

\item{zcol}{Single character string naming the domain variable in
`sc_data$sc`, or NULL for the overall mean.}

\item{na.action}{NA-handling function; one of `stats::na.omit` (default),
`stats::na.exclude`, or `stats::na.fail`. `na.pass` is not supported.}
}
\value{
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`.
}
\description{
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()`.
}
\keyword{internal}
