Package 'SVDMx'

Title: Child/Child-Adult Mortality-Indexed Model Mortality Age Schedules
Description: Model age schedules of mortality, nqx, suitable for a life table. This package implements the SVD-Comp mortality model indexed by either child or child/adult mortality. Given input value(s) of either 5q0 or (5q0, 45q15), the qx() function generates single-year 1qx or 5-year 5qx conditional age-specific probabilities of dying. See Clark (2016) <doi:10.48550/arXiv.1612.01408> and Clark (2019) <doi:10.1007/s13524-019-00785-3>.
Authors: Samuel Clark [aut, cre, cph]
Maintainer: Samuel Clark <[email protected]>
License: GPL (>= 3)
Version: 0.1.0
Built: 2025-03-11 06:16:42 UTC
Source: https://github.com/cran/SVDMx

Help Index


Calculate expit (inverse logit)

Description

Calculate expit (inverse logit)

Usage

expit(x)

Arguments

x

A number on the real line.

Value

The expit of x.

Examples

expit(-5)

Calculate logit

Description

Calculate logit

Usage

logit(x)

Arguments

x

A number in the range (0,1).

Value

The logit of x.

Examples

logit(0.5)

SVD-Comp models data set - 'mods2018'

Description

An R object containing a hierarchy of lists that contain SVD-derived components, estimated model coefficients, and other parameter values necessary to generate new 1qx values using the SVD Component mortality model indexed by child/child-adult mortality implemented by the 'qx()' function. The model objects have been 'cleaned' to remove large collections of data that are not necessary to perform predictions - this dramatically reduces their size. This is the 2018 version of the models that replicates the Demography paper.

Usage

mods2018

Format

An R list object with members:

Female:
comps: 4 raw SVD-derived components
comps.sm: 4 smoothed SVD-derived components
aml: lm() model object for adult mortality model
v1: lm() model object for v1
v2: lm() model object for v2
v3: lm() model object for v3
v4: lm() model object for v4
offset: offset used when calculating SVD
q0: lm() model object for mortality at age 0
rownames: row labels for the predicted values
Male:
comps: 4 raw SVD-derived components
comps.sm: 4 smoothed SVD-derived components
aml: lm() model object for adult mortality model
v1: lm() model object for v1
v2: lm() model object for v2
v3: lm() model object for v3
v4: lm() model object for v4
offset: offset used when calculating SVD
q0: lm() model object for mortality at age 0
rownames: row labels for the predicted values

Author(s)

Samuel J. Clark, [email protected]

Source

See model development in Clark (2016) doi:10.48550/arXiv.1612.01408 and Clark (2019) doi:10.1007/s13524-019-00785-3


SVD-Comp models data set - 'mods2022'

Description

An R object containing a hierarchy of lists that contain SVD-derived components, estimated model coefficients, and other parameter values necessary to generate new 1qx values using the SVD Component mortality model indexed by child/child-adult mortality implemented by the 'qx()' function. The model objects have been 'cleaned' to remove large collections of data that are not necessary to perform predictions - this dramatically reduces their size. This is the 2022 version of the models that includes additional Human Mortality Database life tables available after the Demography paper was published.

Usage

mods2022

Format

An R list object with members:

Female:
comps: 4 raw SVD-derived components
comps.sm: 4 smoothed SVD-derived components
aml: lm() model object for adult mortality model
v1: lm() model object for v1
v2: lm() model object for v2
v3: lm() model object for v3
v4: lm() model object for v4
offset: offset used when calculating SVD
q0: lm() model object for mortality at age 0
rownames: row labels for the predicted values
Male:
comps: 4 raw SVD-derived components
comps.sm: 4 smoothed SVD-derived components
aml: lm() model object for adult mortality model
v1: lm() model object for v1
v2: lm() model object for v2
v3: lm() model object for v3
v4: lm() model object for v4
offset: offset used when calculating SVD
q0: lm() model object for mortality at age 0
rownames: row labels for the predicted values

Author(s)

Samuel J. Clark, [email protected]

Source

See model development in Clark (2016) doi:10.48550/arXiv.1612.01408 and Clark (2019) doi:10.1007/s13524-019-00785-3


SVD-Comp models data set - 'mods2024'

Description

An R object containing a hierarchy of lists that contain SVD-derived components, estimated model coefficients, and other parameter values necessary to generate new 1qx values using the SVD Component mortality model indexed by child/child-adult mortality implemented by the 'qx()' function. The model objects have been 'cleaned' to remove large collections of data that are not necessary to perform predictions - this dramatically reduces their size. This is the 2024 version of the models that includes additional Human Mortality Database life tables available after the Demography paper was published.

Usage

mods2024

Format

An R list object with members:

Female:
comps: 4 raw SVD-derived components
comps.sm: 4 smoothed SVD-derived components
aml: lm() model object for adult mortality model
v1: lm() model object for v1
v2: lm() model object for v2
v3: lm() model object for v3
v4: lm() model object for v4
offset: offset used when calculating SVD
q0: lm() model object for mortality at age 0
rownames: row labels for the predicted values
Male:
comps: 4 raw SVD-derived components
comps.sm: 4 smoothed SVD-derived components
aml: lm() model object for adult mortality model
v1: lm() model object for v1
v2: lm() model object for v2
v3: lm() model object for v3
v4: lm() model object for v4
offset: offset used when calculating SVD
q0: lm() model object for mortality at age 0
rownames: row labels for the predicted values

Author(s)

Samuel J. Clark, [email protected]

Source

See model development in Clark (2016) doi:10.48550/arXiv.1612.01408 and Clark (2019) doi:10.1007/s13524-019-00785-3


Convert life table probabilities of Dying from 1-year to standard 5-year age groups

Description

Convert 1-year life table probabilities of dying 1qx to standard five-year age groups: 0, 1-4, 5-9, etc.

Usage

q1to5(q1)

Arguments

q1

Decimal: the input values for 1qx; either a single vector or a matrix, age x life table.

Value

Data frame: equivalent values for 5qx.

Author(s)

Samuel J. Clark, [email protected]

Examples

q1 <- qx("female",0.08,out5=FALSE)
q1to5(q1)

Generate 1qx or 5qx age schedule of mortality from child or child/adult mortality

Description

Generate single-year 1qx or 5-year 5qx age-specific probabilities of dying using the SVD-Comp mortality model indexed by child mortality, 5q0, or child and adult mortality, 5q0 and 45q15.

Usage

qx(
  sex,
  cm,
  smooth = TRUE,
  outlogit = FALSE,
  out5 = TRUE,
  am = NULL,
  modsv = 2024
)

Arguments

sex

Character: 'female' or 'male'.

cm

Decimal: the input value(s) for 5q0; either a single value or a vector of values.

smooth

Boolean: use either smooth or raw SVD-derived components. Default is TRUE.

outlogit

Boolean: output either logit-scale or natural-scale nqx values. Default is FALSE. When TRUE oldest age not returned because logit(1) not defined.

out5

Boolean: output either 5-year or 1-year age groups. Default is TRUE.

am

Optional decimal: input value(s) for 45q15; either single value or vector of values. If a vector, must have the same number of elements as cm.

modsv

Optional integer: specifies version of calibration models to use: 2018, 2022, or 2024. Defaults is 2024.

Value

Data frame: generated 1qx or 5qx values. Oldest age assumed to be 1.0. Columns labeled with input child mortality values.

Author(s)

Samuel J. Clark, [email protected]

References

Clark (2016) doi:10.48550/arXiv.1612.01408 and Clark (2019) doi:10.1007/s13524-019-00785-3

Examples

qx("female",0.05)
qx("female",0.05,modsv=2022)
qx("male",0.03,am=0.26)
qx("male",0.03,TRUE,TRUE,TRUE,0.26)
qx("male",c(0.03,0.01))