bayesPop (version 6.2-4)

age.specific.migration: Reconstruction of Sex- and Age-specific Migration

Description

Reconstructs the sex- and age-specific net migration datasets out of the total net migration using a residual method.

Usage

age.specific.migration(wpp.year = 2017, years = seq(1955, 2100, by = 5), 
    countries = NULL, smooth = TRUE, rescale = TRUE, ages.to.zero = 18:21,
    write.to.disk = FALSE, directory = getwd(), file.prefix = "migration", 
    depratio = wpp.year == 2015, verbose = TRUE)

Arguments

wpp.year

Integer determining which wpp package should be used to get the necessary data from. That package is required to have a dataset on total net migration (called migration). Currently, only the wpp2017 package contains it (see Details).

years

Array of years that the reconstruction should be made for. This should be a subset of years for which the total net migration is available.

countries

Numerical country codes to do the reconstruction for. By default it is performed on all countries included in the migration dataset where aggregations are excluded.

smooth

Logical controlling if smoothing of the reconstructed curves is required. Due to rounding issues the residual method often yields unrealistic zig-zags on migration curves by age. Smoothing usually improves their look.

rescale

Logical controlling if the resulting migration should be rescaled to match the total migration.

ages.to.zero

Indices of age groups where migration should be set to zero. Default is 85 and older.

write.to.disk

If TRUE results are written to disk.

directory

Directory where to write the results if write.to.disk is TRUE.

file.prefix

If write.to.disk is TRUE results are written into two text files with this prefix, a letter “M” and “F” determining the sex, and concluded by the “.txt” suffix. By default “migrationM.txt” and “migrationF.txt”.

depratio

If it is TRUE it will use an internal dataset on migration dependency ratios to adjust the first three age groups. It can also be a name of a binary file containing such dataset.

verbose

Logical controlling the amount of output messages.

Value

List of two data frames (male and female), each having the same structure as migrationM.

Warning

Due to rounding issues and slight differences in the methodology, this function does not reproduce the unpublished UN datasets exactly. It is only an approximation! Especially, the first age groups might be more off than other ages.

Details

Unlike in wpp2012, for the two latest releases of the WPP, the wpp2015 and wpp2017, the UN Population Division did not publish the sex- and age-specific net migration counts, only the totals. However, since the sex- and age-schedules are needed for population projections, this function attempts to reconstruct those missing datasets. It uses the published population projections by age and sex, fertility and mortality projections from the wpp package. It computes the population projection without migration and sets the residual to the published population projection as the net migration. By default such numbers are then scaled so that the sum over sexes and ages corresponds to the total migration count.

If smooth is TRUE a smoothing procedure is performed over ages where necessary. Also, for simplicity, we set migration of old ages to zero (default is 85+). Both is done before the scaling. If it is desired to obtain raw residuals without any additional processing, set smooth=FALSE, rescale=FALSE, ages.to.zero=c().

See Also

pop.predict, migration migrationM

Examples

Run this code
# NOT RUN {
asmig <- age.specific.migration()
head(asmig$male)
head(asmig$female)
# }

Run the code above in your browser using DataLab