Package: MortalityTables 2.0.5

MortalityTables: A Framework for Various Types of Mortality / Life Tables

Classes to implement, analyze and plot cohort life tables for actuarial calculations. Birth-year dependent cohort mortality tables using a yearly trend to extrapolate from a base year are implemented, as well as period life table, cohort life tables using an age shift, and merged life tables. Additionally, several data sets from various countries are included to provide widely-used tables out of the box.

Authors:Reinhold Kainhofer [aut, cre, cph]

MortalityTables_2.0.5.tar.gz
MortalityTables_2.0.5.zip(r-4.5)MortalityTables_2.0.5.zip(r-4.4)MortalityTables_2.0.5.zip(r-4.3)
MortalityTables_2.0.5.tgz(r-4.4-any)MortalityTables_2.0.5.tgz(r-4.3-any)
MortalityTables_2.0.5.tar.gz(r-4.5-noble)MortalityTables_2.0.5.tar.gz(r-4.4-noble)
MortalityTables_2.0.5.tgz(r-4.4-emscripten)MortalityTables_2.0.5.tgz(r-4.3-emscripten)
MortalityTables.pdf |MortalityTables.html
MortalityTables/json (API)
NEWS

# Install 'MortalityTables' in R:
install.packages('MortalityTables', repos = c('https://kainhofer.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/kainhofer/mortalitytables/issues

Datasets:

On CRAN:

5.70 score 1 stars 2 packages 84 scripts 283 downloads 66 exports 29 dependencies

Last updated 12 months agofrom:650b2586f3. Checks:OK: 7. Indexed: yes.

TargetResultDate
Doc / VignettesOKOct 30 2024
R-4.5-winOKOct 30 2024
R-4.5-linuxOKOct 30 2024
R-4.4-winOKOct 30 2024
R-4.4-macOKOct 30 2024
R-4.3-winOKOct 30 2024
R-4.3-macOKOct 30 2024

Exports:agesageShiftbaseTablebaseYearcalculateImprovementscommutationNumbersdeathProbabilitiesdeathProbabilitiesIndividualfillAgesfitExpExtrapolationgenerateAgeShiftgetCohortTablegetOmegagetPeriodTablelifeTablemakeQxDataFramemortalityComparisonTablemortalityImprovementmortalityTablemortalityTable.ageShiftmortalityTable.deMoivremortalityTable.improvementFactorsmortalityTable.jointLivesmortalityTable.MakehamGompertzmortalityTable.mixedmortalityTable.NAmortalityTable.observedmortalityTable.oncemortalityTable.onceAndFuturemortalityTable.periodmortalityTable.trendProjectionmortalityTable.WeibullmortalityTable.zeroesmortalityTables.listmortalityTables.loadmT.addTrendmT.cleanupmT.extrapolateProbsExpmT.extrapolateTrendExpmT.fillAgesmT.fitExtrapolationLawmT.roundmT.scaleProbsmT.setDimInfomT.setNamemT.setTrendmT.switchovermT.translatepensionTablepensionTables.listpensionTables.loadperiodDeathProbabilitiesperiodDeathProbabilitiesIndividualperiodTransitionProbabilitiesplotMortalityTableComparisonsplotMortalityTablesplotMortalityTrendpT.calculateTotalMortalitypT.getSubTablepT.recalculateTotalMortalitypT.setDimInfosetLoadingsetModificationtransitionProbabilitiesundampenTrendwhittaker.mortalityTable

Dependencies:clicolorspacefansifarverggplot2gluegtableisobandlabelinglatticelifecyclemagrittrMASSMatrixmgcvmunsellnlmepillarpkgconfigpracmaR6RColorBrewerrlangscalestibbleutf8vctrsviridisLitewithr

International Mortality Tables Overview

Rendered frominternational-mortality-tables-overview.Rmdusingknitr::rmarkdownon Oct 30 2024.

Last update: 2023-10-19
Started: 2020-09-20

Using the MortalityTables Package

Rendered fromusing-the-mortalityTables-package.Rmdusingknitr::rmarkdownon Oct 30 2024.

Last update: 2023-10-27
Started: 2016-09-04

Readme and manuals

Help Manual

Help pageTopics
Provide life table classes for life insurance purposesMortalityTables-package MortalityTables
Return the defined ages of the life tableages ages,mortalityTable.jointLives-method ages,mortalityTable.mixed-method ages,mortalityTable.observed-method ages,mortalityTable.period-method
Return the age shift of the age-shifted life table given the birth yearageShift ageShift,mortalityTable-method ageShift,mortalityTable.ageShift-method
Return the base table of the life tablebaseTable baseTable,mortalityTable-method baseTable,mortalityTable.jointLives-method baseTable,mortalityTable.period-method
Return the base year of the life tablebaseYear baseYear,mortalityTable-method baseYear,mortalityTable.jointLives-method baseYear,mortalityTable.mixed-method
Calculate the improvement factors for the given birth-year and the 'mortalityTable.improvementFactors' objectcalculateImprovements calculateImprovements,mortalityTable.improvementFactors-method
Calculate the commutation numbers for the given parameters, using the mortality table and an interest ratecommutationNumbers commutationNumbers,mortalityTable-method commutationNumbers,numeric-method commutationNumbers,pensionTable-method
Return the (cohort) death probabilities of the life table given the birth year (if needed)deathProbabilities deathProbabilities,mortalityTable.ageShift-method deathProbabilities,mortalityTable.improvementFactors-method deathProbabilities,mortalityTable.jointLives-method deathProbabilities,mortalityTable.mixed-method deathProbabilities,mortalityTable.observed-method deathProbabilities,mortalityTable.period-method deathProbabilities,mortalityTable.trendProjection-method
Return a matrix of the persons' individual death probabilities of a joint-life table (instance of 'mortalityTable.jointLives')deathProbabilitiesIndividual
Fill the given probabilities with NA to match the desired age range.fillAges
Fit an exponential function exp(-A*(x-x0)) to the last value (f(100) and f'(100) need to coincide):fitExpExtrapolation
Generate data.frame containing age shifts for each birth yeargenerateAgeShift
Return the cohort life table as a 'mortalityTable.period' objectgetCohortTable getCohortTable,mortalityTable-method
Return the maximum age of the life tablegetOmega getOmega,mortalityTable.jointLives-method getOmega,mortalityTable.mixed-method getOmega,mortalityTable.observed-method getOmega,mortalityTable.period-method
Return the period life table as a 'mortalityTable.period' objectgetPeriodTable getPeriodTable,mortalityTable-method
Return the lifetable object (package lifecontingencies) for the cohort life tablelifeTable lifeTable,array-method lifeTable,list-method lifeTable,mortalityTable-method lifeTable,NULL-method
Converts one or multiple mortality table objects to a data frame that can be plotted by 'plotMortalityTables' or 'plotMortalityTableComparisons'makeQxDataFrame
Calculate relative mortalities for age bands and birth yearsmortalityComparisonTable
Return the mortality trend (yearly log-death-probability improvement) of the given period or the given generation.mortalityImprovement mortalityImprovement,mortalityTable-method
Class mortalityTablemortalityTable mortalityTable-class
Class mortalityTable.ageShift - Cohort life tables generated by age-shiftmortalityTable.ageShift mortalityTable.ageShift-class
Class mortalityTable.deMoivre - Mortality table with de Moivre's lawmortalityTable.deMoivre mortalityTable.deMoivre-class
Class mortalityTable.improvementFactors - Cohort life table with improvement factorsmortalityTable.improvementFactors mortalityTable.improvementFactors-class
Class mortalityTable.jointLives - Life table for multiple joint livesmortalityTable.jointLives mortalityTable.jointLives-class
Class mortalityTable.MakehamGompertz - Mortality table with Makeham-Gompertz's lawmortalityTable.MakehamGompertz mortalityTable.MakehamGompertz-class
Class mortalityTable.mixed - Life table as a mix of two life tablesmortalityTable.mixed mortalityTable.mixed-class
Empty mortality table indicating NAmortalityTable.NA
Class mortalityTable.observed - Life table from actual observationsmortalityTable.observed mortalityTable.observed-class
Generate a (deterministic) mortality table with only one probability set to 1 (for the given age)mortalityTable.once
Generate a (deterministic) mortality table with all probabilities starting at a given age set to 1mortalityTable.onceAndFuture
Class mortalityTable.period - Period life tablesmortalityTable.period mortalityTable.period-class
Class mortalityTable.trendProjection - Cohort mortality table with age-specific trendmortalityTable.trendProjection mortalityTable.trendProjection-class
Class mortalityTable.Weibull - Mortality table with Weibull's lawmortalityTable.Weibull mortalityTable.Weibull-class
Generate a mortality table with all probabilities set to zero.mortalityTable.zeroes
List all available sets of life tables provided by the MortalityTables-package package An existing life table can then be loaded with mortalityTables.load.mortalityTables.list
Load a named set of mortality tables provided by the MortalityTables packagemortalityTables.load
Remove all non-essential data (raw data, etc.) from a mortalityTable objectmT.cleanup mT.cleanup,array-method mT.cleanup,list-method mT.cleanup,mortalityTable-method mT.cleanup,mortalityTable.observed-method mT.cleanup,mortalityTable.period-method mT.cleanup,mortalityTable.trendProjection-method mT.cleanup,pensionTable-method
Extrapolate base table of a mortalityTable using an exponential functionmT.extrapolateProbsExp
Extrapolate a mortality trend exponentiallymT.extrapolateTrendExp
Restrict/expand a mortalityTable to certain agesmT.fillAges
Fit interpolation law to a mortality table and extrapolatemT.fitExtrapolationLaw
Round all components of a mortality table to the given number of digitsmT.round mT.round,array-method mT.round,list-method mT.round,mortalityTable-method mT.round,mortalityTable.improvementFactors-method mT.round,mortalityTable.observed-method mT.round,mortalityTable.period-method mT.round,mortalityTable.trendProjection-method mT.round,pensionTable-method
Scale all probabilities of the given 'mortalityTable' object(s) by the given factormT.scaleProbs
Set additional information (year, description, type of risk, sex, etc.) for the mortality table.mT.setDimInfo
Sets a new name for the given mortality table or the list/table/array of mortalityTablesmT.setName
Set/Add a trend vector for the probabilities of the given 'mortalityTable' object(s). Returns a 'mortalityTable.trendProjection' objectmT.addTrend mT.setTrend
Switch over mortalities from one table to another at a given agemT.switchover
Translate base table of a cohort mortality table to a different observation yearmT.translate
Class pensionTablepensionTable pensionTable-class
List all available sets of pension tables provided by the MortalityTables-package package An existing pension table can then be loaded with pensionTables.load.pensionTables.list
Load a named set of pension tables provided by the MortalityTables packagepensionTables.load
Return the (period) death probabilities of the life table for a given observation yearperiodDeathProbabilities periodDeathProbabilities,mortalityTable.ageShift-method periodDeathProbabilities,mortalityTable.improvementFactors-method periodDeathProbabilities,mortalityTable.jointLives-method periodDeathProbabilities,mortalityTable.mixed-method periodDeathProbabilities,mortalityTable.observed-method periodDeathProbabilities,mortalityTable.period-method periodDeathProbabilities,mortalityTable.trendProjection-method
Return a matrix of the persons' individual period death probabilities of a joint-life table (instance of 'mortalityTable.jointLives')periodDeathProbabilitiesIndividual
Return all period transition probabilities of the pension tableperiodTransitionProbabilities periodTransitionProbabilities,pensionTable-method
Plot multiple mortality tables (life tables) in one plotplot.mortalityTable
Plot multiple mortality tables (life tables) in one plot, relative to a given reference tableplotMortalityTableComparisons
Plot multiple mortality tables (life tables) in one plotplotMortalityTables
Plot the trends of multiple mortality tables (life tables) in one chartplotMortalityTrend
Austrian population count (exposure) and deaths in 2017PopulationData.AT2017
Calculate the total mortality of the pension tablepT.calculateTotalMortality pT.recalculateTotalMortality
Extract a sub-table from a pensionTablepT.getSubTable
Set additional information (year, description, type of risk, sex, etc.) for the pension table.pT.setDimInfo
Return a copy of the table with an additional loading addedsetLoading setLoading,mortalityTable-method
Return a copy of the table with the given modification function addedsetModification setModification,mortalityTable-method
Return all transition probabilities of the pension table (generational probabilities)transitionProbabilities transitionProbabilities,pensionTable-method
Return a 'mortalityTable.trendProjection' object with the trend damping removed.undampenTrend undampenTrend,mortalityTable.trendProjection-method
Smooth a life table using the Whittaker-Henderson method, intepolation possibly missing valueswhittaker.mortalityTable