compute_starting_points_from_microdata: Compute Starting Points from Raw PNADC Microdata

View source: R/mensalize-sidra-series.R

compute_starting_points_from_microdataR Documentation

Compute Starting Points from Raw PNADC Microdata

Description

Complete 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.

Details

This function performs the complete workflow:

  1. Build crosswalk via pnadc_identify_periods()

  2. Calibrate weights via pnadc_apply_periods()

  3. Compute z_ aggregates via compute_z_aggregates()

  4. Fetch SIDRA rolling quarters

  5. Compute starting points via compute_series_starting_points()

Value

data.table with columns:

series_name

Character. Series name

mesnotrim

Integer. Month position (1, 2, or 3)

y0

Numeric. Starting point value

Weight Calibration

All months are scaled uniformly to SIDRA monthly population totals.

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

## Not run: 
stacked <- fst::read_fst("pnadc_stacked.fst", as.data.table = TRUE)

y0 <- compute_starting_points_from_microdata(stacked)

bundled <- pnadc_series_starting_points
comparison <- merge(y0, bundled, by = c("series_name", "mesnotrim"))

## End(Not run)


PNADCperiods documentation built on April 28, 2026, 9:07 a.m.