% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/LT.R
\name{LT}
\alias{LT}
\title{Life table}
\usage{
LT(age, sex = "m", mx, ax = NULL, w = NULL, l0 = 1)
}
\arguments{
\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{sex}{Character. Sex. \code{"m"} for males or \code{"f"} for females. By default = \code{"m"}.}

\item{mx}{Numeric array with age specific mortality rates.}

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

\item{w}{Optional. Numeric array with weights for each age interval for calculating weighted life expectancy (\code{wex}).}

\item{l0}{Numeric. Life table radix. By default, = \code{1} but it can be any positive real number. In "human" demography tradition it is 100'000, in "ecological" and "evolutionary" demography tradition it is 1.}
}
\value{
A numeric matrix with one row per age group. Standard columns are
\code{age}, \code{mx}, \code{ax}, \code{qx}, \code{lx}, \code{dx}, \code{Lx}, \code{Tx}, and \code{ex}. If \code{w} is
supplied, additional columns \code{w}, \code{wLx}, and \code{wex} are appended, where
\code{wex} is weighted life expectancy.
}
\description{
Life table
}
\details{
By default, \eqn{a_x} for age 0 (first entity in \code{ax}) is modeled as in Andreev & Kingkade (2015, p. 390, see table 3-2).

The weighted life expectancy is calculated as follows:
\deqn{e_x^w = \frac{\sum_{i = x}^{\omega}L_x w_x}{l_x}}
where \eqn{\omega} is the last age, \eqn{w} is weight s.t. \eqn{w \in [0,1]}, and other variables are life table functions.
}
\examples{
# Minimal toy example
age <- 0:5
mx <- c(0.02, 0.01, 0.012, 0.015, 0.02, 0.03)
LT(age = age, sex = "m", mx = mx)
\donttest{
if (interactive()) {
  # Real RosBris data via get_rosbris(): Russian males, 2010
  rus2010 <- subset(get_rosbris("mortality_5"),
    year == 2010 & code == 1100 & sex == "m" & territory == "t"
  )
  LT(age = rus2010$age, sex = "m", mx = rus2010$mx)
}
}
}
\references{
Andreev, E. M., & Kingkade, W. W. (2015). Average age at death in infancy and infant mortality level: Reconsidering the Coale-Demeny formulas at current levels of low mortality. \emph{Demographic Research}, \emph{33}, 363-390.
}
\seealso{
\code{\link[=MLT]{MLT()}} for Multiple Decrement Life Table.
}
