net_migration: Calculate net migration from a vital object

View source: R/net_migration.R

net_migrationR Documentation

Calculate net migration from a vital object

Description

Calculate net migration from a vital object

Usage

net_migration(deaths, births)

Arguments

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.

Value

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().

References

Hyndman and Booth (2008) Stochastic population forecasts using functional data models for mortality, fertility and migration. International Journal of Forecasting, 24(3), 323-342.

Examples

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)

vital documentation built on Oct. 5, 2026, 9:08 a.m.