Learn R Programming

⚠️There's a newer version (2.1.3) of this package.Take me there.

MortalityLaws: Parametric Mortality Models, Life Tables and HMD

Fit the most popular human mortality laws, and construct full and abridge life tables given various input indices. A mortality law is a parametric function that describes the dying-out process of individuals in a population during a significant portion of their life spans. For a comprehensive review of the most important mortality laws see Tabeau (2001). An elegant function for downloading data from Human Mortality Database is provided as well.

Installation

  1. Make sure you have the most recent version of R
  2. Run the following code in your R console
install.packages("MortalityLaws")

Updating to the latest version of the package

You can track and contribute to the development of MortalityLaws on GitHub. To install it:

  1. Install the release version of devtools from CRAN with install.packages("devtools").

  2. Make sure you have a working development environment.

    • Windows: Install Rtools.
    • Mac: Install Xcode from the Mac App Store.
    • Linux: Install a compiler and various development libraries (details vary across different flavors of Linux).
  3. Install the development version of MortalityLaws.

    devtools::install_github("mpascariu/MortalityLaws")

Help

All functions are documented in the standard way, which means that once you load the package using library(MortalityLaws) you can just type ?MortalityLaw to see the help file.

Copy Link

Version

Install

install.packages('MortalityLaws')

Monthly Downloads

891

Version

1.4.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Marius Pascariu

Last Published

June 20th, 2018

Functions in MortalityLaws (1.4.0)

availableLF

Check Available Loss Function
ahmd

England and Wales Demographic Data
ggompertz

Gamma-Gompertz Model as in Vaupel et al. (1979)
availableLaws

Check Available Mortality Laws
plot.MortalityLaw

Plot Function for MortalityLaw
choose_optim

Select an optimizing method
coale.demeny.ax

Find ax[1:2] indicators using Coale-Demeny coefficients Here we adjust the first two values of ax to account for infant mortality more accurately
availableHMD

Check Data Availability in HMD
deviance.MortalityLaw

deviance function for MortalityLaw
compute.ax

Find ax indicator
makeham0

Makeham Mortality Law - informative parameterization
opperman

Opperman Mortality Law
makehambeard

Makeham-Beard Model
logLik.MortalityLaw

logLik function for MortalityLaw
perks

Perks Model
predict.MortalityLaw

Predict function for MortalityLaw
makeham

Makeham Mortality Law
print.ReadHMD

Print ReadHMD
df.residual.MortalityLaw

df.residual function for MortalityLaw
print.availableHMD

Print for availableHMD
gompertz

Gompertz Mortality Law
print.summary.MortalityLaw

Print summary.MortalityLaw
quadratic

Quadratic Model
gompertz0

Gompertz Mortality Law - informative parameterization
kannisto

Kannisto Mortality Law
head_tail

Summary function - display head and tail in a single data.frame The original code for this function was first written for 'psych' R package here we have modified it a bit
kostaki

Kostaki Model
print.LifeTable

Print LifeTable
onAttach

onAttach
objective_fun

Function to be Optimize
find.my.case

Function that identifies the case/problem we have to solve It also performs several checks
invgompertz

Inverse-Gompertz Mortality Law - informative parameterization
rogersplanck

Rogers-Planck Model
scale_x

Scaling method for x vector
invweibull

Inverse-Weibull Mortality Law
wittstein

Wittstein Mortality Law
martinelle

Martinelle Model
print.MortalityLaw

Print MortalityLaw
print.availableLF

Print availableLF
mx_qx

mx to qx
vandermaen2

Van der Maen 2 Model
weibull

Weibull Mortality Law
siler

Siler Mortality Law
print.availableLaws

Print availableLaws
thiele

Thiele Mortality Law
vandermaen

Van der Maen Model
summary.MortalityLaw

Summary MortalityLaw
MortalityLaw

Fit Mortality Laws
LifeTable

Life Table Function
HP2

Heligman-Pollard 2 Mortality Law - 8 parameters
AIC.MortalityLaw

AIC function for MortalityLaw
HP3

Heligman-Pollard 3 Mortality Law - 9 parameters
LifeTable.core

LifeTable.core
HMDcountries

Country codes
beard

Beard Model
bring_parameters

Bring or Rename Starting Parameters in the Law Functions
ReadHMD

Download Mortality and Population Data (HMD)
HP4

Heligman-Pollard 4 Mortality Law - 9 parameters
HP

Heligman-Pollard Mortality Law - 8 parameters
LifeTable.check

Check LifeTable input
ReadHMD.core

Function to Download Data for a one Country
carriere2

Carriere Mortality Law
carriere1

Carriere Mortality Law
check.MortalityLaw

Function to check input data in MortalityLaw
check_input_ReadHMD

Check input ReadHMD