View source: R/mensalize-sidra-series.R
| compute_series_starting_points | R Documentation |
For advanced users who want to compute custom starting points using their own calibrated microdata estimates.
compute_series_starting_points(
monthly_estimates,
rolling_quarters,
calibration_start = NULL,
calibration_end = NULL,
scale_factor = 1000,
use_series_specific_periods = TRUE,
verbose = TRUE
)
monthly_estimates |
data.table with columns:
|
rolling_quarters |
data.table from |
calibration_start |
Integer. Start of calibration period (YYYYMM). Default NULL uses .PNADC_DATES$DEFAULT_CALIB_START (201301). Note: CNPJ series automatically use CNPJ_CALIB_START (201601) regardless. |
calibration_end |
Integer. End of calibration period (YYYYMM). Default NULL uses .PNADC_DATES$DEFAULT_CALIB_END (201912). |
scale_factor |
Numeric. Scale factor for z_ values (usually 1000). Default 1000. |
use_series_specific_periods |
Logical. If TRUE (default), use series-specific calibration periods for CNPJ series (201601-201912) and cumsum starting dates (201510). Set to FALSE to use uniform calibration for all series. |
verbose |
Logical. Print progress? Default TRUE. |
The starting points (y0) are computed by:
Calculating cumulative variations from SIDRA rolling quarters
Computing backprojection: e0 = z / scale_factor - cum
Averaging e0 by mesnotrim over the calibration period
data.table with columns:
Character. Series name
Integer. Month position (1, 2, or 3)
Numeric. Starting point value
When use_series_specific_periods = TRUE, the following series receive
special handling for series-specific data availability:
empregadorcomcnpj, empregadorsemcnpj, contapropriacomcnpj, contapropriasemcnpj use calibration period 201601-201912 and cumsum starts from 201510 (when V4019 became available)
## Not run:
rq <- fetch_sidra_rolling_quarters()
z_agg <- compute_z_aggregates(calibrated_data)
y0 <- compute_series_starting_points(z_agg, rq)
monthly <- mensalize_sidra_series(rq, starting_points = y0)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.