propopbirth package
Birth rate forecasts based on FSO (Federal Statistical Office) methodology
The {propopbirth} package consists of three modules: First, model
input data are calculated. Second, TFR (total fertility rate) and MAB
(mean age of the mother at birth) are predicted. Third, TFR and MAB
forecasts are used to predict the age-specific birth rates.
The output from {propopbirth} is fully compatible with
{propop} - An R package for population projections in R.
{propop} needs future
birth rates as input. This is only available at the FSO at cantonal
level. {propopbirth} can also calculate birth rates for
other spatial units or with own hypothesis.
To install the current github version of the package, make sure you have devtools installed and type:
devtools::install_github("statistik-aargau/propopbirth")
The package includes three vignettes.
With population scenario models, it is always necessary to check whether the spatial units are large enough to ensure that meaningful forecast estimates. There is no population limit specification by the FSO, when not to run the forecast models. However, it visual checks are advisable (see vignette graphs for examples). These are helpful to verify whether the estimates for the birth rate forecasts are meaningful.
Currently, FSO birth data is not accessible with the required variables.
For this reason, the birth data (up to year 2023) is included in the {propopbirth}
package. As soon as the birth data is publicly accessible (similar to
population data), it will be directly accessible in {propopbirth} .
This will allow a more flexible selection of spatial units (not only
municipalities, but also districts).
Detailed examples with explanations are provided in the vignettes (step by step). This is an example of entire birth rate forecast for three municipalities:
library(propopbirth)
library(dplyr)
input <- create_input_data(
population = fso_pop,
births = fso_birth |>
dplyr::filter(spatial_unit %in% c("Aarau", "Uster", "Stadt Zürich")),
year_first = 2011,
year_last = 2023,
age_fert_min = 15,
age_fert_max = 49,
fert_hist_years = 3,
binational = TRUE
)
forecast_tfr <- forecast_tfr_mab(
topic = "tfr",
topic_data = input$tfr,
trend_model = c(
model = "lm", start = 2024, end = 2026, trend_past = 7, trend_prop = 0.5
),
temporal_model = c(
model = "cubic", start = 2027, end = 2055, trend_prop = 0.8, z0_prop = 0.7,
z1_prop = 0
),
temporal_end = NA,
constant_model = c(model = "constant", start = 2056, end = 2075)
)
forecast_mab <- forecast_tfr_mab(
topic = "mab",
topic_data = input$mab,
trend_model = c(
model = "lm", start = 2024, end = 2026, trend_past = 7, trend_prop = 0.5
),
temporal_model = c(
model = "Bezier", start = 2027, end = 2055, trend_prop = 0.3, z0_prop = 0.7,
z1_prop = 0
),
temporal_end = NA,
constant_model = c(model = "constant", start = 2056, end = 2075)
)
forecast_fer <- forecast_fertility_rate(
fer_dat = input$fer,
tfr_dat = forecast_tfr,
mab_dat = forecast_mab,
year_begin = 2024,
year_end = 2075)
We acknowledge the Federal Statistical Office (FSO) for providing their SAS code
used for fertility projections. And we are grateful to the FSO for giving the
permission to use the birth data within the {propopbirth} package.