BuildViP {VirtualPop}R Documentation

Builds a Virtual Population in a Single Step

Description

Builds a virtual population from mortality and fertility rates retrieved from the Human Mortality Database (HMD) and the Human Fertility Database (HFD) in a single step.

Usage

BuildViP(
  user = NULL,
  pw_HMD = NULL,
  pw_HFD = NULL,
  countrycode,
  cohort = NULL,
  refyear = NULL,
  ncohort,
  ngen,
  mort = TRUE
)

Arguments

user

User name (e-mail address)

pw_HMD

Password Human Mortality Database

pw_HFD

Password Human Fertility Database

countrycode

Code of country selected

cohort

Birth cohort (for virtual population based on cohort data)

refyear

Reference year (for virtual population based on period data)

ncohort

Size of initial cohort

ngen

Number of generations

mort

Presence or absence of mortality (optional). Default: mortality is present (mort=TRUE). If mortality is absent, mort=FALSE.

Value

dLH Dataframe with virtual population (one row per individual) (See description of dLH object).

Examples

## Registration is required to be able to download data from the HMD and HFD
## HMD: https://www.mortality.org
## HFD: https://www.humanfertility.org
## Not run: 
# Period data
dLH <- BuildViP(user,pw_HMD,pw_HFD,
                    countrycode="USA",
                    refyear=2021,
                    ncohort=1000,
                    ngen=4)
# Cohort data
dLHc <- BuildViP(user,pw_HMD,pw_HFD,
                    countrycode="USA",
                    cohort=1964,
                    ncohort=1000,
                    ngen=4)

## End(Not run)

[Package VirtualPop version 2.0.2 Index]