Learn R Programming

poputils (version 0.6.1)

tfr_to_asfr_scale: Derive Age-Specific Fertility Rates that Match Total Fertility Rates by Scaling

Description

Turn total fertility rates (TFRs) into sets of age-specific fertility rates, by scaling a set of standard rates upwards or downwards.

Usage

tfr_to_asfr_scale(target, standard, suffix = NULL)

Value

A tibble.

Arguments

target

A data frame containing a variable called "tfr", and possibly others. See Details.

standard

A data frame containing variables called age and asfr, and possibly others. See Details.

suffix

Optional suffix added to asfr column in results.

Method

Let \({}_nf_x\) be the age-specific fertility rate for people aged between \(x\) and \(x+n\). Values for \({}_nf_x\) are obtained by scaling the standard rates \({}_nf_x^{\mathrm{std}}\) so that they agree with the target total fertility rate \(F\). That is, tfr_to_asfr_scale() sets

$${}_nf_x = \alpha \times {}_nf_x^{\mathrm{std}}$$

where

$$\alpha = \frac{F}{\sum_x n \times {}_nf_x^{\mathrm{std}}}$$

The <code>target</code> argument

target is a data frame specifying total fertility rates for each population being modelled.

target contains the following variables:

  • A variable called "tfr". An ordinary numeric vector or an rvec().

  • Optionally, 'by' variables. Typical examples are time, region, and model variant.

The <code>standard</code> argument

standard is a data frame specifying standard fertility schedules to be used with each life expectancy in target. Values in standard are age-specific.

standard contains the following variables:

  • A variable called "age", with labels that can be parsed by reformat_age().

  • A variable called "value", containing non-negative values. Cannot be an rvec.

  • Additional variables used to match rows in standard to rows in target.

See Also

  • ex_to_lifetab_brass() Life table equivalent of tfr_to_asfr_scale().

  • booth_standard The 'Booth standard' fertility schedule

  • tfr Calculate total fertility rate from age-specific fertility rates

Examples

Run this code
## create age-specific fertility rates
## based on the [Booth standard][booth_standard]
library(dplyr, warn.conflicts = FALSE)
target <- data.frame(region = c("A", "B"), 
                     tfr = c(5.5, 4.7))
asfr <- tfr_to_asfr_scale(target = target,
                          standard = booth_standard)
asfr

## check consistency with original TFRs
asfr |>
  tfr(asfr = asfr, by = region)

## target is an rvec
library(rvec, warn.conflicts = FALSE)
target_rvec <- data.frame(region = c("A", "B"), 
                          tfr = rnorm_rvec(n = 2,
                                           mean = c(5.5, 4.7),
                                           n_draw = 1000))
tfr_to_asfr_scale(target = target_rvec,
                  standard = booth_standard)

Run the code above in your browser using DataLab