% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pwmean_s3_helper.R
\name{standardize_zcol}
\alias{standardize_zcol}
\title{Standardize a domain variable into a common internal format}
\usage{
standardize_zcol(data, zcol = NULL)
}
\arguments{
\item{data}{A data frame containing the column named by `zcol`.}

\item{zcol}{Single character string naming the domain variable in `data`,
or NULL for the overall (no-domain) case.}
}
\value{
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.
}
\description{
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.
}
\keyword{internal}
