Mxc2e0abrvec {DemoDecomp}R Documentation

get life expectancy at birth from the vec of an age-cause matrix

Description

Given a vector with abridged ages stacked within causes of death, assign its dimensions, take the age marginal sums using Mxc2e0abr, then calculate life expectancy at birth using LTabr().

Usage

Mxc2e0abrvec(Mxcvec, dims, trans = FALSE)

Arguments

Mxcvec

numeric vector, c(Mxc).

dims

integer vector of length two, c(nrow(Mxc),ncol(Mxc)).

trans

do we need to transpose in order to arrive back to an age-cause matrix?

Details

This assumes that the marginal row sums give all-cause mortality rates. Give an other category if you need to top-up to all-cause mortality. Do not include all-cause mortality itself! length(Mxcvec) must equal prod(dim(Mxc)). This function is meant to be fed to a generic decomposition function, such as stepwise_replacement(), or DecompContinuousOrig().

Value

numeric life expectancy at birth


[Package DemoDecomp version 1.0.1 Index]