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.
Net migration at age x in year t is for the cohort aged x at the end of year t (on 1 January
of year t+1), so it equals the population aged x on 1 January of year t+1, minus the cohort's
population on 1 January of year t (births during year t for age 0, and the two oldest ages
combined for the open age group), plus the cohort's deaths during year t. Deaths are
estimated from the survivorship ratios of the life table, as in demography::netmigration().
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_files("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.