mig_un_fam: Net migration by age for an UN family

View source: R/mig_un_fam.R

mig_un_famR Documentation

Net migration by age for an UN family

Description

Given a total net migration, calculate the net migration age schedule based on the Rogers and Castro formula for UN families.

Usage

mig_un_fam(NM, family, Single = TRUE, OAnew = 100)

Arguments

NM

numeric. Total net migration to distribute between ages and sex.

family

character. Could be "Family", "Female Labor", "Male Labor".

Single

logical. Results by simple age. Default TRUE. Typically from pre-working age and working age parts of in Roger-Castro formula.

OAnew

The age from which to group all ages into an open ended age group. By default it is set to 100, so it groups all ages up to 120, which is the maximum age.

Value

List with

  • params_RC data.frame. Roger-Castro parameters in a data.frame. Same as mig_un_params data.

  • net_migr data.frame. Net migrants by age and sex for the chosen family.

Examples

# 10000 net migrants, comparing two possible families
nm1 <- mig_un_fam(NM = 10000, family = "Male Labor", OAnew = 100)
nm2 <- mig_un_fam(NM = 10000, family = "Family", OAnew = 100)
# See the female profile in for these models:
## Not run: 
plot(nm1$net_migr$age[nm1$net_migr$sex=="Female"],
     nm1$net_migr$nm[nm1$net_migr$sex=="Female"],
     xlab="Age",ylab="nm",ylim=c(0,300))
points(nm2$net_migr$age[nm2$net_migr$sex=="Female"],
       nm2$net_migr$nm[nm2$net_migr$sex=="Female"], col=2)

## End(Not run)

timriffe/DemoTools documentation built on Jan. 28, 2024, 5:13 a.m.