# hiv.mortmod: HIV calibrated model life tables for countries with... In HIV.LifeTables: HIV calibrated model life tables for countries with generalized HIV epidemics

## Description

This function produces a complete set of mortality rates for ages 0, 1-4, 5-9, 10-14, ...,100+ and life table given a region, sex, and set of inputs which must include HIV prevalence and one of the following mortality indicators: life expectancy at birth (e0), child mortality alone (5q0), or child mortality with adult mortality (45q15)

## Usage

 ```1 2``` ```hiv.mortmod(prev=NULL, e0=NULL, child.mort = NULL, adult.mort = NULL, model = 1, region = 1, sex = 1, lt = FALSE, nax=NULL, opt=TRUE) ```

## Arguments

 `prev` HIV prevalence expressed as a percentage `e0` Life expectancy at birth (used only if model=1) `child.mort` Probability of death between age 0 and 5, 5q0 (used only if model=2 or model=3) `adult.mort` Probability of death between age 15 and 60, 45q15 (used only if model=3) `model` An interger to indicate which inputs will be used on the model. 1 for life expectancy, 2 for child mortality alone, 3 for child mortality with adult mortality `region` An integer to indicate which regional model to use. 1 for Africa, 0 for Caribbean or Latin American `sex` An interger to indicate the sex of the desired life table. 1 for female, 0 for male `lt` Logical. If TRUE a life table is calculated based on the estimated mortality rates. The user can supply nax values. Otherwise, the assumption of half the length of the age interval is used for nax values. `nax` If lt=TRUE, the user can supply a set of nax values `opt` If model=1, opt=TRUE will use a value for the weight for the first SVD component that produces a set of age-specific mortality rates that produce a life exepctancy at birth that matches the input life exepctancy.

## Value

 `nmx` The estimated nmx values produced by the model `lt` If `lt=TRUE` A life table with age intervals matching those of the nmx schedule on which the table is built and with columns for age, nax, nmx, nqx, npx, ndx, lx, nLx, Tx, and ex. `lt.5q0` If `lt=TRUE` The probability of death between birth and age 5 `lt.45q15` If `lt=TRUE` The probability of death between age 15 and 60

## Note

If `lt=TRUE`, it is possible that the life table contains fewer age groups than the 22 in the estimated mortality rates if the mortality rates are high enough to kill off all people before the final age group, 100+.

## Author(s)

David J Sharrow

`mortmod.e0`, `mortmod.5q0`, `mortmod.45q15`
 ```1 2 3 4 5 6``` ```## a life table at 1.5 percent prevalence, life expectancy of 60, for Africa Females hiv.mortmod(prev=1.5, e0=60, model=1, region=1, sex=1, lt=TRUE) ## a set of mortality rates at 2.5 percent prevalence, life expectancy of 53, ## for Caribbean Males hiv.mortmod(prev=2.5, e0=53, model=1, region=0, sex=0, lt=FALSE) ```