get_asfr: Age-specific fertility rates

Description Usage Arguments Value Examples

Description

This function computes age-specific fertility rates for a female, population being exposed (i.e. living years between age 15 and 45, see United Nations, 2008).

Usage

1
2
get_asfr(x, df_ped, evmat, evmat_bak, include_twins = FALSE,
  treshold_date = as.Date("1830-01-01"))

Arguments

x

The individual IDs of females of interests

df_ped

A dataframe

evmat

Event matrix (twins count as one)

evmat_bak

Event matrix (including all twins)

include_twins

Should twins count as multiple births? Default to FALSE

treshold_date

Maximum date to include mothers with completed fertility. Default is "1830-01-01" for the Krummhörn data.

Value

A dataframe with 'age', 'years' (i.e. number of years, where females have been exposed), 'nbirth' (number of births, or children being born see include_twins), 'nwomen' (number of women being ever exposed), 'asfr' (resulting age-specific fertility rate in births/1000 women/year).

Examples

1
2
3
4
5
6
## Not run: 
x <- which(attr(evmat, "dimnames")$id %in% df_ped$id[!is.na(df_ped$bdate) &
           df_ped$sex==2] &  (evmat[,20,1]- evmat[,1,1])/365.25 >= 15)
get_asfr(x, df_ped, evmat, evmat_bak)

## End(Not run)

johow/kinlab documentation built on July 5, 2019, 4:23 p.m.