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

View source: R/bh.R

ggbsegMakeColumnsR Documentation

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

Description

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

Usage

ggbsegMakeColumns(
  codi,
  minA = 15,
  maxA = 75,
  agesFit.ggb,
  eOpen = NULL,
  deaths.summed = FALSE,
  mig.summed = deaths.summed,
  lm.method = "oldschool",
  nx.method = 2
)

Arguments

codi

a chunk of data (single sex, year, region, etc) with all columns required by ggbseg()

minA

the lowest age to be included in search

maxA

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

agesFit.ggb

vector of ages for calculating coverage in the GGB method.

eOpen

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

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.

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

nx.method

integer. either 2 or 4. 4 is smoother.

Details

agesFit is a vector passed in from ggbsegMakeColumns(), and it was either estimated using the GGB automatic method there, or simply came from the argument exact.ages specified in ggbseg(). By default we just automatically estimate these. eOpen can be either user-specified, or it will be estimated automatically using eOpenCD().

Value

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


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