model.LiLee: The Li-Lee Mortality Model

Description Usage Arguments Details Value References See Also Examples

View source: R/model_LiLee.R

Description

Fit the Li-Lee mortality model

Usage

1
model.LiLee(data, data.B, x = NULL, y = NULL, verbose = TRUE, ...)

Arguments

data

A data.frame or a matrix containing mortality data with ages x as row and time y as column.

data.B

A data.frame or a matrix containing mortality data for the benchmark population. Must be the same format as in data;

x

Numerical vector indicating the ages in input data. Optional. Default: NULL.

y

Numerical vector indicating the years in input data. Optional. Default: NULL.

verbose

A logical value. Set verbose = FALSE to silent the process that take place inside the function and avoid progress messages.

...

Arguments to be passed to or from other methods.

Details

\insertNoCite

li2005MortalityForecast

Value

The output is a list with the components:

input

List with arguments provided in input. Saved for convenience;

info

Short details about the model;

call

An unevaluated function call, that is, an unevaluated expression which consists of the named function applied to the given arguments;

coefficients

Estimated coefficients;

fitted.values

Fitted values of the estimated model;

observed.values

The observed values used in fitting arranged in the same format as the fitted.values;

residuals

Deviance residuals;

x

Vector of ages used in the fitting;

y

Vector of years used in the fitting;

benchmark

An object of class LeeCarter containing the fitted model for the benchmark population.

References

\insertAllCited

See Also

predict.LiLee

Examples

1
2
3
4
5
6
7
8
9
# Data
x <- 0:89
y <- 1985:2014
B.mx <- HMD_male$mx$USA[paste(x), paste(y)]
mx <- HMD_male$mx$GBRTENW[paste(x), paste(y)]

M <- model.LiLee(data = mx, data.B = B.mx, x = x, y = y) # fit
P <- predict(M, h = 20)  # forecast
P

mpascariu/MortalityForecast documentation built on Sept. 28, 2020, 2:40 p.m.