% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mensalize-sidra-series.R
\name{compute_z_aggregates}
\alias{compute_z_aggregates}
\title{Compute z_ Aggregates from Monthly Microdata}
\usage{
compute_z_aggregates(calibrated_data, verbose = TRUE)
}
\arguments{
\item{calibrated_data}{PNADC microdata output from \code{pnadc_apply_periods()}
with \code{calibrate = TRUE}. Must include \code{weight_monthly},
\code{ref_month_yyyymm}, and \code{ref_month_in_quarter}.}

\item{verbose}{Print progress messages.}
}
\value{
data.table with columns:
\describe{
\item{anomesexato}{Integer YYYYMM month}
\item{z_*}{Numeric weighted aggregates for each series (one column per series)}
}
}
\description{
Computes monthly z_ aggregates from PNADC microdata using calibrated monthly
weights, with options for different population scaling approaches.
}
\details{
This function creates z_ indicator variables and aggregates them using the
calibrated \code{weight_monthly} from \code{pnadc_apply_periods()}.

The \code{pnadc_apply_periods()} function implements the calibration
methodology as follows:
All months are scaled uniformly to SIDRA monthly population totals.

This function simply aggregates the indicators using the already-calibrated weights.
}
\examples{
\dontrun{
crosswalk <- pnadc_identify_periods(stacked_data)

calibrated <- pnadc_apply_periods(stacked_data, crosswalk,
                                   weight_var = "V1028",
                                   anchor = "quarter",
                                   calibration_unit = "month")

z_agg <- compute_z_aggregates(calibrated)

rq <- fetch_sidra_rolling_quarters()
y0 <- compute_series_starting_points(z_agg, rq)
}

}
\seealso{
\code{\link{pnadc_apply_periods}} for the calibration step
\code{\link{compute_series_starting_points}} for the y0 computation
}
