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

704

Version

1.5.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Marius Pascariu

Last Published

July 29th, 2018

Functions in MortalityLaws (1.5.0)

HP3

Heligman-Pollard 3 Mortality Law - 9 parameters
df.residual.MortalityLaw

df.residual function for MortalityLaw
bring_parameters

Bring or Rename Starting Parameters in the Law Functions
LifeTable.check

Check LifeTable input
carriere1

Carriere Mortality Law
LifeTable.core

LifeTable.core
ReadHMD.core

Function to Download Data for a one Country
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
LawTable

Compute Life Tables from Parameters of a Mortality Law
compute.ax

Find ax indicator
ahmd

England and Wales Demographic Data
LifeTable

Compute Life Tables from Mortality Data
gompertz

Gompertz Mortality Law
gompertz0

Gompertz Mortality Law - informative parameterization
find.my.case

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

Check Data Availability in HMD
ggompertz

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

Kostaki Model
predict.MortalityLaw

Predict function for MortalityLaw
print.LifeTable

Print LifeTable
logLik.MortalityLaw

logLik function for MortalityLaw
availableLF

Check Available Loss Function
makehambeard

Makeham-Beard Model
scale_x

Scaling method for x vector
martinelle

Martinelle Model
makeham

Makeham Mortality Law
makeham0

Makeham Mortality Law - informative parameterization
AIC.MortalityLaw

AIC function for MortalityLaw
siler

Siler Mortality Law
onAttach

onAttach
opperman

Opperman Mortality Law
HP

Heligman-Pollard Mortality Law - 8 parameters
print.availableHMD

Print for availableHMD
HMDcountries

Country codes
MortalityLaw

Fit Mortality Laws
print.availableLF

Print availableLF
quadratic

Quadratic Model
ReadHMD

Download Mortality and Population Data (HMD)
HP2

Heligman-Pollard 2 Mortality Law - 8 parameters
vandermaen

Van der Maen Model
vandermaen2

Van der Maen 2 Model
availableLaws

Check Available Mortality Laws
rogersplanck

Rogers-Planck Model
weibull

Weibull Mortality Law
beard

Beard Model
wittstein

Wittstein Mortality Law
check_input_ReadHMD

Check input ReadHMD
carriere2

Carriere Mortality Law
check.MortalityLaw

Function to check input data in MortalityLaw
choose_optim

Select an optimizing method
invweibull

Inverse-Weibull Mortality Law
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
invgompertz

Inverse-Gompertz Mortality Law - informative parameterization
perks

Perks Model
plot.MortalityLaw

Plot Function for MortalityLaw
print.ReadHMD

Print ReadHMD
print.MortalityLaw

Print MortalityLaw
mx_qx

mx to qx
objective_fun

Function to be Optimize
print.availableLaws

Print availableLaws
print.summary.MortalityLaw

Print summary.MortalityLaw
summary.MortalityLaw

Summary MortalityLaw
thiele

Thiele Mortality Law
HP4

Heligman-Pollard 4 Mortality Law - 9 parameters
deviance.MortalityLaw

deviance function for MortalityLaw