segMakeColumns: make the Bennett-Horiuchi quasi life table columns required...

View source: R/bh.R

segMakeColumnsR Documentation

make the Bennett-Horiuchi quasi life table columns required by the estimation method

Description

Called by segCoverageFromYear(). This simply modulates some code that would otherwise be repeated. Users probably don't need to call this function directly.

Usage

segMakeColumns(
  codi,
  minA = 15,
  maxA = 75,
  eOpen = NULL,
  nx.method = 2,
  deaths.summed = FALSE,
  mig.summed = deaths.summed,
  delta = FALSE,
  exact.ages.ggb = NULL,
  lm.method = "oldschool",
  opt.method = "r2",
  minAges.ggb = 8
)

Arguments

codi

data.frame with columns, $pop1, $pop2, $deaths, $date1, $date2, $sex, $age, and $id (to indicate regions, periods, sexes).

minA

the lowest age to be included in search

maxA

the highest age to be included in search (the lower bound thereof)

eOpen

optional. A user-specified value for remaining life-expectancy in the open age group.

nx.method

either 2 or 4. 4 is smoother.

deaths.summed

logical. is the deaths column given as the total per age in the intercensal period (TRUE). By default we assume FALSE, i.e. that the average annual was given.

mig.summed

logical. Is the (optional) net migration column mig given as the total per age in the intercensal period (TRUE). By default we assume FALSE, i.e. that the average annual was given.

delta

logical. Do we perform the so-called delta adjustment?

exact.ages.ggb

optional vector of ages used to estimate GGB coverage (if delta is TRUE)

lm.method

character, one of:

  • "oldschool" default sd ratio operation of still unknown origin

  • "lm" or "ols" for a simple linear model

  • "tls", "orthogonal", or "deming" for total least squares

  • "tukey", "resistant", or ""median" for Tukey's resistant line method

opt.method

what kind of residual do we minimize? choices "RMS","logRMS", "ORSS", "logORSS" (experimental)

minAges.ggb

the minimum number of adjacent ages to be used in estimating GGB coverage.

Value

codi, with many columns added, most importantly $Cx.


albinomatheus/toolbox documentation built on June 13, 2024, 5:42 a.m.