% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/decomp.R
\name{decomp}
\alias{decomp}
\title{Age decomposition of mortality: single decrement process}
\usage{
decomp(mx1, mx2, sex = "m", age, method = "andreev", ax1 = NULL, ax2 = NULL)
}
\arguments{
\item{mx1}{Numeric array with age specific mortality rates of population 1 (base population).}

\item{mx2}{Numeric array with age specific mortality rates of population 2 (compared population).}

\item{sex}{Character. Sex. "m" for males and "f" for females. By default, \code{sex = "m"}.}

\item{age}{Numeric array of age intervals; for full life table = \code{0:100}; for concise life table = \code{c(0:1, seq(5,85,5))}}

\item{method}{Character. Decomposition method. "andreev" (1982), "arriaga" (1984) or "pollard" (1982) - slightly different in their results. By default, \code{method = "andreev"}.}

\item{ax1}{Optional. Numeric array with ax for the 1st population. By default, it is a the middle of the interval, while ax for age 0 is modeled as in Andreev & Kingkade (2015).}

\item{ax2}{Optional. Numeric array with ax for the 2nd population. By default, it is a the middle of the interval, while ax for age 0 is modeled as in Andreev & Kingkade (2015).}
}
\value{
A data frame with one row per age group. It always contains \code{age},
\code{ex12}, and \code{ex12_prc}, where \code{ex12} is the absolute age contribution to
the life-expectancy difference and \code{ex12_prc} is the percentage
contribution. Additional columns depend on \code{method} and contain
intermediate life-table quantities used in the decomposition.
}
\description{
Age decomposition of mortality: single decrement process
}
\details{
Example of decomposition using Andreev (1982) formulas:
\deqn{\Delta_x = l_x^2(e_x^2 - e_x^1) - l_{x+n}^2(e_{x+n}^2 - e_{x+n}^1), \ \ \ x \neq \omega}
\deqn{\Delta_{\omega} = l_{\omega}^2(e_{\omega}^2 - e_{\omega}^1)}
where \eqn{\Delta_x} is an absolute contribution of age \eqn{x} to difference in \eqn{e_0} between the second and the first population. \eqn{e_x^i, l_x^i} are life table functions for population \eqn{i}. \eqn{\omega} is the last age group. Note, \eqn{e_0^2 - e_0^1 = \sum_{x}^{\omega}\Delta_x}
}
\examples{
age <- 0:5
mx1 <- c(0.02, 0.01, 0.012, 0.015, 0.02, 0.03)
mx2 <- c(0.018, 0.009, 0.011, 0.014, 0.019, 0.028)
decomp(mx1, mx2, age = age)$ex12
}
\references{
\enumerate{
\item Arriaga, E. E. (1984). Measuring and explaining the change in life expectancies. \emph{Demography}, \emph{21}, 83-96.
\item Andreev, E. M. (1982). Metod komponent v analize prodolzhitel'nosti zhizni. \emph{Vestnik statistiki}, \emph{9}, 42-47.
\item Pollard, J. H. (1982). The expectation of life and its relationship to mortality. \emph{Journal of the Institute of Actuaries}, \emph{109(2)}, 225–240.
}
}
\seealso{
\code{\link[=mdecomp]{mdecomp()}} for age and cause decomposition
}
