Computes age-specific fertility rates per province, year, and single year of mother's age, following INE's methodology for its Indicadores Demograficos Basicos (INE, Indicadores Demograficos Basicos: Metodologia, pp. 4 and 9-10):
age_specific_fertility_rate(
births_age_df,
pop_df,
age_min = 15L,
age_max = 49L
)Tibble as returned by get_ine_births_by_age()$data
(columns nuts3_code, province_name, year, age, female, total,
and optionally age_group).
Population tibble as returned by get_ine_population()$data
(columns nuts3_code, year, age, female), January-1 stocks.
Integer bounds of the reproductive age span (default 15-49).
A tibble with nuts3_code, province_name, year, age,
births, women (mean annual female population), asfr (births per
woman), asfr_female (female births per woman, for
gross_reproduction_rate() and net_reproduction_rate()),
asfr_per_1000 (1000 * asfr, for display), and is_boundary_year.
Exposure is the mean annual female population, the average of the
January-1 stocks of years t and t + 1. If the t + 1 stock is not in
pop_df, the t stock is used and the row is flagged with
is_boundary_year = TRUE (with a warning).
Out-of-range births are folded into the boundary ages: births to
mothers younger than age_min (including INE's "under 15" group, coded
age = NA, age_group = "under15") are added to age age_min, and births
to mothers older than age_max (INE's "50 and over") to age age_max.
No births are dropped.
births_age <- tibble::tibble(
nuts3_code = "ES111", province_name = "A Coruna", year = 2023,
age = c(20, 30), female = c(10, 25), total = c(20, 50)
)
pop <- tibble::tibble(
nuts3_code = "ES111", year = rep(2023:2024, each = 2), age = c(20, 30, 20, 30),
female = c(2000, 2500, 2100, 2400)
)
age_specific_fertility_rate(births_age, pop)
#> # A tibble: 2 × 10
#> nuts3_code province_name year age births women asfr asfr_female
#> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 ES111 A Coruna 2023 20 20 2050 0.00976 0.00488
#> 2 ES111 A Coruna 2023 30 50 2450 0.0204 0.0102
#> # ℹ 2 more variables: asfr_per_1000 <dbl>, is_boundary_year <lgl>