LifeTableMx | R Documentation |

Functions for obtaining life table quantities.

```
LifeTableMx(mx, sex = c("Male", "Female", "Total"), include01 = TRUE,
abridged = TRUE, radix = 1, open.age = 130)
LifeTableMxCol(mx, colname = c("Lx", "lx", "qx", "mx", "dx", "Tx", "sx", "ex", "ax"), ...)
```

`mx` |
Vector of age-specific mortality rates nmx. If |

`sex` |
For which sex is the life table. |

`include01` |
Logical. If it is |

`abridged` |
Logical. If |

`radix` |
Base of the life table. |

`open.age` |
Open age group. If smaller than the last age group of |

`colname` |
Name of the column of the life table that should be returned. |

`...` |
Arguments passed to underlying functions, e.g. |

Function `LifeTableMx`

returns a life table for one set of mortality rates. Function `LifeTableMxCol`

returns one column of the life table for (possibly) multiple sets of mortality rates. The underlying workhorse here is the `life.table`

function from the MortCast package. These functions only collapse the first age groups if needed for an abridged life table (`LifeTableMx`

) or/and combine results for multiple time periods into one object (`LifeTableMxCol`

).

Function `LifeTableMx`

returns a data frame with the following elements:

`age` |
Age groups |

`mx` |
mx, the input vector of mortality rates. |

`qx` |
nqx, probability of dying between ages x ad x+n. |

`lx` |
lx, number left alive at age x. |

`dx` |
ndx, cohort deaths between ages x ad x+n. |

`Lx` |
nLx, person-years lived between ages x and x+n. |

`sx` |
sx, survival rate at age x. |

`Tx` |
Tx, person-years lived above age x. |

`ex` |
e0x, expectation of life at age x. |

`ax` |
nax, average person-years lived in the interval by those dying in the interval. |

Function `LifeTableMxCol`

returns one given column of the life table, possibly as a matrix (if `mx`

is a matrix).

Hana Sevcikova, Thomas Buettner, Nan Li, Patrick Gerland

Preston, P., Heuveline, P., Guillot, M. (2001): Demography. Blackwell Publishing Ltd.

`life.table`

, `pop.expressions`

for examples on retrieving some life table quantities.

```
## Not run:
sim.dir <- tempfile()
pred <- pop.predict(countries="Ecuador", output.dir=sim.dir, wpp.year=2015,
present.year=2015, keep.vital.events=TRUE, fixed.mx=TRUE, fixed.pasfr=TRUE)
# get male mortality rates from 2020 for age groups 0-1, 1-4, 5-9, ...
mxm <- pop.byage.table(pred, expression="MEC_M{age.index01(27)}", year=2020)[,1]
print(LifeTableMx(mxm), digits=3)
# female LT with first two age categories collapsed
mxf <- pop.byage.table(pred, expression="MEC_F{age.index01(27)}", year=2020)[,1]
print(LifeTableMx(mxf, sex="Female", include01=FALSE), digits=3)
unlink(sim.dir, recursive=TRUE)
## End(Not run)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.