Compute Starting Points from Raw PNADC Microdata
Source:R/mensalize-sidra-series.R
compute_starting_points_from_microdata.RdComplete workflow to compute y0 starting points from raw PNADC microdata. This is a convenience wrapper that combines period identification, weight calibration, z_ aggregation, and starting point computation.
Usage
compute_starting_points_from_microdata(
data,
calibration_start = NULL,
calibration_end = NULL,
verbose = TRUE
)Arguments
- data
Stacked PNADC microdata (multiple quarters). Must contain variables for period identification (see
pnadc_identify_periods).- calibration_start
Integer. Start of calibration period (YYYYMM). Default NULL uses .PNADC_DATES$DEFAULT_CALIB_START (201301).
- calibration_end
Integer. End of calibration period (YYYYMM). Default NULL uses .PNADC_DATES$DEFAULT_CALIB_END (201912).
- verbose
Print progress messages.
Value
data.table with columns:
- series_name
Character. Series name
- mesnotrim
Integer. Month position (1, 2, or 3)
- y0
Numeric. Starting point value
Details
This function performs the complete workflow:
Build crosswalk via
pnadc_identify_periods()Calibrate weights via
pnadc_apply_periods()Compute z_ aggregates via
compute_z_aggregates()Fetch SIDRA rolling quarters
Compute starting points via
compute_series_starting_points()
See also
pnadc_apply_periods for the weight calibration step
compute_z_aggregates for the z_ aggregation step
compute_series_starting_points for the y0 computation
pnadc_identify_periods for period identification
Examples
if (FALSE) { # \dontrun{
# Load stacked PNADC data
stacked <- fst::read_fst("pnadc_stacked.fst", as.data.table = TRUE)
# Compute starting points
y0 <- compute_starting_points_from_microdata(stacked)
# Compare with bundled values
bundled <- pnadc_series_starting_points
comparison <- merge(y0, bundled, by = c("series_name", "mesnotrim"))
} # }