GetGenerations {VirtualPop} | R Documentation |
Builds a Multi-Generation Virtual Population from demographic parameters
Description
Builds a virtual population from mortality rates by age and sex, and fertility rates by age of mother and parity.
Usage
GetGenerations(rates, ncohort = NULL, ngen = NULL, mort = NULL)
Arguments
rates |
List object with death rates (ASDR) and birth rates (ASFR). Produced by function VirtualPop::GetRates(). Rates of USA 2021 are distributed with the VirtualPop package. |
ncohort |
Size of hypothetical birth cohort (first generation) |
ngen |
Number of generations to be simulated. No upper limit. |
mort |
Presence or absence of mortality. This parameter is optional. Default is TRUE. If mortality is absent, mort=FALSE. |
Value
dataAllgen |
The database of simulated individual lifespans and fertility histories (all generations). |
The object dataAllgen has four attributes:
country |
The country |
type |
The type of data (period data or cohort data). |
refyear |
The calendar year for which the period data are used (reference year). |
cohort |
The birth cohort (if applicable). |
Examples
utils::data(rates,package = "VirtualPop")
dLH <- VirtualPop::GetGenerations (rates=rates,ncohort=1000,ngen=4)