Calculate Net Reproductive Rate (NRR) from age-specific fertility rate (ASFR), sex-ratio at birth (SRB), and person-years (nLx) and generate nrr variable in the data.table.

calculate_nrr(
  dt,
  id_cols,
  reproductive_age_start = 10,
  reproductive_age_end = 55
)

Arguments

dt

[data.table()]
Input data with 'asfr', sex-ratio at birth ('srb'), and 'nLx'.

id_cols

[character()]
Columns that uniquely identify observations in dt. Must include 'age_start', 'age_end', and 'sex'.

reproductive_age_start

[numeric(1)]
Age in years of start of reproductive age span (default 15 years).

reproductive_age_end

[numeric(1)]
Age in years of end of reproductive age span (default 50 years).

Value

dt [data.table()]

Data table with nrr by id_cols (excluding 'age_start' and 'age_end').

Details

Calculate proportion female: prop_female = (1 / srb) / (1 + (1 / srb)). Then, calculate NRR: sum(asfr * prop_female * nLx) over age, by id columns.

See also

Preston Demography textbook page 113 (Section 5.5 Reproduction Measures).

Examples

dt <- data.table::data.table(
  age_start = seq(15, 45, 5),
  age_end = seq(20, 50, 5),
  sex = "female",
  asfr = c(0.00002, 0.009, 0.1, 0.18, 0.19, 0.11, 0.03),
  srb = 1.057,
  nLx = c(4.61, 4.55, 4.48, 4.39, 4.30, 4.18, 4.03)
)
output <- calculate_nrr(
  dt,
  id_cols = c("age_start", "age_end", "sex"),
  reproductive_age_start = 15,
  reproductive_age_end = 50
)
#> Interval group 1 of 1: [15, 20),[20, 25),[25, 30),[30, 35),[35, 40),[40, 45),[45, 50)