Computes the general fertility rate (births per 1,000 women of reproductive age) per province and year, joining get_ine_births() and get_ine_population() output.

general_fertility_rate(births_df, pop_df, age_min = 15L, age_max = 49L)

Arguments

births_df

Births tibble as returned by get_ine_births()$data (columns nuts3_code, province_name, year, total).

pop_df

Population tibble as returned by get_ine_population()$data (columns nuts3_code, year, age, female).

age_min

Integer, the youngest age counted as reproductive-age (default 15).

age_max

Integer, the oldest age counted as reproductive-age (default 49).

Value

A tibble with nuts3_code, province_name, year, gfr.

Details

GFR improves on crude_birth_rate() by dividing births by the female population actually at risk of childbearing (age age_min-age_max, default 15-49) instead of the total population — this removes the distortion crude_birth_rate() suffers when two provinces have different age/sex structures (e.g. one with proportionally more elderly residents) despite similar underlying fertility behavior.

GFR is still not a total fertility rate (TFR): it is a single aggregate rate over all reproductive-age women, not an age-specific schedule. For a true TFR, use get_ine_births_by_age() with age_specific_fertility_rate()/total_fertility_rate() instead.

Examples

births <- tibble::tibble(
  nuts3_code = "ES111", province_name = "A Coruna", year = 2023, total = 100
)
pop <- tibble::tibble(
  nuts3_code = "ES111", year = 2023, age = c(10, 25, 40, 60),
  female = c(2000, 2500, 2500, 3000)
)
general_fertility_rate(births, pop)
#> # A tibble: 1 × 4
#>   nuts3_code province_name  year   gfr
#>   <chr>      <chr>         <dbl> <dbl>
#> 1 ES111      A Coruna       2023    20