View source: R/net_migration.R
net_migration | R Documentation |
Calculate net migration from a vital object
net_migration(deaths, births)
deaths |
A vital object containing at least a time index, age, population at 1 January, and death rates. |
births |
A vital object containing at least a time index and number of births per time period. It is assumed that the population variable is the same as in the deaths object, and that the same keys other than age are present in both objects. |
A vital object containing population, estimated deaths (not actual deaths) and net migration, using the formula Net Migration = Population - lag(Population cohort) - Deaths + Births. Births are returned as Population at Age -1, and deaths are estimated from the life table
Hyndman and Booth (2008) Stochastic population forecasts using functional data models for mortality, fertility and migration. International Journal of Forecasting, 24(3), 323-342.
net_migration(norway_mortality, norway_births)
## Not run:
# Files downloaded from the [Human Mortality Database](https://mortality.org)
deaths <- read_hmd_files(c("Population.txt", "Mx_1x1.txt"))
births <- read_hmd_file("Births.txt")
mig <- net_migration(deaths, births)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.