mig_beta: Estimate intercensal migration by comparing census...

View source: R/mig_beta.R

mig_betaR Documentation

Estimate intercensal migration by comparing census population, by age and sex, to the results of a RUP projection.

Description

This methods projects population from the first starting point to next census without migration and computes the "Net Census Error" (NCE) which is Census - Estimate by age from projection. It then distributes the NCE over the cohort parallelogram assuming uniform distribution assuming it is all migration. It finalizes by summing the estimate by age groups across the entire intercensal period to have a total migration during the entire period. Alternatively, a child adjustment and an old age adjustment can be applied.

Usage

mig_beta(
  c1,
  c2,
  date1,
  date2,
  age1 = 1:length(c1) - 1,
  age2 = 1:length(c2) - 1,
  dates_out = NULL,
  lxMat = NULL,
  age_lx = NULL,
  dates_lx = NULL,
  births = NULL,
  years_births = NULL,
  location = NULL,
  sex = "both",
  midyear = FALSE,
  verbose = TRUE,
  child_adjust = c("none", "cwr", "constant"),
  childage_max = NULL,
  cwr_factor = 0.3,
  oldage_adjust = c("none", "beers", "mav"),
  oldage_min = 65,
  ...
)

Arguments

c1

numeric vector. The first (left) census in single age groups

c2

numeric vector. The second (right) census in single age groups

date1

reference date of c1'. Either a Date class object or an unambiguous character string in the format "YYYY-MM-DD".

date2

reference date of c2'. Either a Date class object or an unambiguous character string in the format "YYYY-MM-DD".

age1

integer vector. single ages of c1

age2

integer vector. single ages of c2

dates_out

vector of desired output dates coercible to numeric using dec.date()

lxMat

numeric matrix containing lifetable survivorship, l(x). Each row is an age group and each column a time point. At least two intercensal time points needed.

age_lx

integer vector. Age classes in lxMat

dates_lx

date, character, or numeric vector of the column time points for lxMat. If these are calendar-year estimates, then you can choose mid-year time points

births

integer vector. Raw birth counts for the corresponding (sub)-population, one value per each year of the intercensal period including both census years. The first and last years should include all births in the given year; don't discount them in advance.

years_births

numeric vector of calendar years of births.

location

country name or LocID

sex

character string, either "male", "female", or "both"

midyear

logical. FALSE means all Jan 1 dates between date1 and date2 are returned. TRUE means all July 1 intercensal dates are returned.

verbose

logical. Shall we send informative messages to the console?

child_adjust

The method with which to adjust the youngest age groups. If "none", no adjustment is applied (default). If child-woman ratio ("cwr") is chosen, the first cohorts reflecting the difference between date2 - date1 are adjusted (plus age 0). If child constant ratio ("constant") is chosen, the first 15 age groups are adjusted.

childage_max

The maximum age from which to apply child_adjust. By default, set to NULL, which gets translated into all the cohorts between date2 and date1. If date2 is 2010 and date1 is 2002, the first 8 cohorts are adjusted. Otherwise, the user can supply an integer.

cwr_factor

A numeric between 0 and 1 to which adjust the CWR method for the young ages from child_adjust. This is only used when child_adjust is "cwr".

oldage_adjust

The type of adjustment to apply to ages at and above oldage_min. 'beers' applies a beers graduation method while 'mav' applies a moving average with cascading on the tails. For more information see ?mav and ?graduation_beers.

oldage_min

The minimum age from which to apply oldage_adjust. By default, set to 65, so any adjustment from oldage_adjust will be applied for 65+.

...

optional arguments passed to lt_single_qx

Value

a numeric vector of the total migration in the intercensal period for each age. Ages are set as names of each migration estimate.

Examples


## Not run: 

mig_beta(
  location = "Russian Federation",
  sex = "male",
  c1 = pop1m_rus2002,
  c2 = pop1m_rus2010,
  date1 = "2002-10-16",
  date2 = "2010-10-25",
  age1 = 0:100,
  births = c(719511L, 760934L, 772973L, 749554L, 760831L, 828772L, 880543L, 905380L, 919639L)
)

## End(Not run)

timriffe/DemoTools documentation built on Oct. 14, 2024, 12:53 p.m.