Learn R Programming

ilc (version 1.0)

lca.dev.res: Miscellaneous utility functions for lca and lca.rh type regression objects. Deviance residuals of the Lee-Carter model

Description

A simple utility function to replace the original residuals (e.g. logrates, rates, deaths) of a LC fit with deviance residuals without the need to re-estimate the regression parameters. We note that the estimation of the parameters can be particularly slow in the case of the APC model.

Usage

lca.dev.res(lca.obj, pop, clip = 0)

Arguments

lca.obj
an object of class lca
pop
matrix of population data corresponding to the fitted mortality rates
clip
number of years to clip from start and end of cohort years

Value

An identical regression object as lca.obj containing the corresponding deviance residuals

Details

The Lee-Carter regression object contains the type of residuals specified in the original function call, which might need to be changed for further analysis, but without actually re-running the entire iterative estimation process.

See Also

lca.rh

Examples

Run this code
# original model object with 'logrates' residuals
mod6 <- lca.rh(dd.cmi.pens, mod="lc", error="gauss", max=110, interpolate=TRUE)
# adjusted model object with 'deviance' residuals: 
dev6 <- lca.dev.res(mod6, insp.dd(dd.cmi.pens, "pop"))

Run the code above in your browser using DataLab