% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/yll.R
\name{yll}
\alias{yll}
\title{Years of Life Lost (YLL) calculation}
\usage{
yll(
  Dx,
  type = c("yll", "yll.p", "yll.r", "asyr"),
  age.int = 5,
  Dx_all = NULL,
  pop = NULL,
  w = NULL,
  standard = NULL
)
}
\arguments{
\item{Dx}{Array with the number of deaths.}

\item{type}{Character. Type of YLL to calculate. See details section.}

\item{age.int}{Numeric. Age interval of Dx. Can be \code{1} or \code{5}.}

\item{Dx_all}{Array with the number of all deaths. Used only with \code{yll.p} type, where \code{Dx} is array with cause-specific deaths.}

\item{pop}{Array with population. Used only with \code{yll.r} and \code{asyr} types.}

\item{w}{Array with population weights for direct standardization. Used only with \code{asyr} type.}

\item{standard}{Data frame. User-specific standard life expectancy to calculate YLL with the following columns: age, ex. Note: the \code{age.int} argument should be consistent with the \code{age} column in this data frame.}
}
\value{
A list whose components depend on \code{type}. For \code{type = "yll"}, the
list contains \code{yll_all} (overall YLL) and \code{yll} (age-specific YLL). For
\code{type = "yll.p"}, it contains \code{yll.p_all} and \code{yll.p} (overall and
age-specific YLL proportions). For \code{type = "yll.r"}, it contains
\code{yll.r_all} and \code{yll.r} (overall and age-specific YLL rates). For
\code{type = "asyr"}, it contains \code{asyr_all} and \code{asyr} (overall and
age-specific age-standardized YLL rates).
}
\description{
Years of Life Lost (YLL) calculation
}
\details{
Computes four types of Years of Life Lost (YLL) indicators:
\itemize{
\item \strong{Absolute YLL} (\code{type = "yll"}):
\deqn{YLL_{x,t,c} = D_{x,t,c} \times SLE_x}
where \eqn{x,t,c} are age, time, and cause respectively, \eqn{D_{x,t,c}} is deaths in age \eqn{x} at time \eqn{t} from cause \eqn{c} and \eqn{SLE_x} is standard life expectancy at age \eqn{x}
\item \strong{YLL proportion} (\code{type = "yll.p"}):
\deqn{YLL_{x,t,c}^p = \frac{YLL_{x,t,c}}{YLL_{x,t}}}
where \eqn{YLL_{x,t} = \sum_{c} YLL_{x,t,c}} (total YLL across causes)

\item \strong{YLL rate} (\code{type = "yll.r"}):
\deqn{YLL_{x,t,c}^r = \left( \frac{YLL_{x,t,c}}{N_{x,t}} \right) \times 100'000}
where \eqn{N_{x,t}} is population in age group \eqn{x} at time \eqn{t}

\item \strong{Age-standardized YLL rate} (\code{type = "asyr"}):
\deqn{ASYR_{t,c} = \sum_{x=\alpha}^{\omega} \left( YLL_{x,t,c}^r \times w_x \right)}
where \eqn{\alpha} to \eqn{\omega} corresponds to first to last age group, \eqn{w_x} is standard population weight for age \eqn{x}.
}
}
\examples{
yll(Dx = rep(1, 19), type = "yll", age.int = 5)$yll_all
}
\references{
Martinez, R., Soliz, P., Caixeta, R., & Ordunez, P. (2019). Reflection on modern methods: years of life lost due to premature mortality—a versatile and comprehensive measure for monitoring non-communicable disease mortality. \emph{International Journal of Epidemiology}, \emph{48}, 1367–1376.
}
