kannisto.predict: Kannisto Prediction

View source: R/kannisto.R

kannisto.predictR Documentation

Kannisto Prediction

Description

Given estimated Kannisto parameters (coherent or original), it predicts mortality rates for given ages.

Usage

kannisto.predict(pars, ages)

Arguments

pars

A named vector with Kanisto coefficients c and d (e.g. result of kannisto.estimate or cokannisto.estimate).

ages

A vector of ages to make prediction for. These can be indices of age groups or raw ages, but on the same scale as used in the estimation.

Details

Given parameters c and d in pars, the function uses the Kannisto equation logit(mx) = log(c) + dx, to predict mortality rates for age groups x given by ages.

Value

Vector of predicted mortality rates.

References

Thatcher, A. R., Kannisto, V. and Vaupel, J. W. (1998). The Force of Mortality at Ages 80 to 120, volume 5 of Odense Monographs on Population Aging Series. Odense, Denmark: Odense University Press.

See Also

cokannisto, kannisto.estimate, cokannisto.estimate

Examples

data(mxM, mxF, package = "wpp2017")
mxm <- subset(mxM, name == "Germany")[,"2010-2015"]
ages <- c(0, 1, seq(5, 130, by=5))

# using original Kannisto parameters
pars <- kannisto.estimate(mxm[18:21], ages = ages[18:21])
mxm.pred <- kannisto.predict(pars$coefficients, ages = ages[22:28])
plot(ages, c(mxm[1:21], mxm.pred), type="l", log="y", 
    xlab="age", ylab="mx")
    
# Coherent Kannisto
mxf <- subset(mxF, name == "Germany")[,"2010-2015"]
copars <- cokannisto.estimate(
   mxm[18:21], mxf[18:21], ages = ages[18:21])
cmxm.pred <- kannisto.predict(copars[["male"]]$coefficients, ages = ages[22:28])
cmxf.pred <- kannisto.predict(copars[["female"]]$coefficients, ages = ages[22:28])
plot(ages, c(mxm[1:21], cmxm.pred), type="l", log="y", 
    xlab="age", ylab="mx", col="blue")
lines(ages, c(mxf[1:21], cmxf.pred), col="red")


PPgp/MortCast documentation built on June 12, 2022, 12:53 a.m.