HMDdata

HMDdata is a package I have compiled to speed up my work on mortality analysis. It does not aim to be universal and fully tested as a CRAN package. It is more a user-friendly tool for extracting 1x1 mortality data from the Human Mortality Database (HMD). More complete and general R-code for similar purposes are available on Tim Riffe's web-site.

So, HMDdata is nothing complex and there are no models/statistics involved. It is a product of an afternoon-work when I have got bothered by the tedious job of selecting every time specific data from the HMD in a matrix formats. Therefore I decided to include all 45 HMD populations in an R-package and I provide a user-friendly R-function for extracting them. I also update my own database twice a year by including latest years for already included populations, and newly added populations.

Unfortunately the package HMDdata can't be publicly available because it include many information coming from the Human Mortality Database (HMD) and distributing the data would violate the HMD user agreement (paragraph 3: "Please do not pass your copy of these data to other users...."). Hence if you need it or you would like to have a look, please write me an email: carlo-giovanni.camarda at ined.fr

Specifically, data for deaths, population, exposures and rates are available in 1x1 age-year intervals (HMDdata). Two functions are also provided:

- selectHMDdata: select a specific dataset and create an HMDdata object

- plot.HMDdata: simple plot of an HMDdata object

The manual can be found here and below some example and the instruction for installation.

Needless to say that any suggestion/comment/criticism is more than welcome. I hope you'll find it useful and easy to use. Otherwise have a nice day!

## EXAMPLE:

## load the package

library(HMDdata)

## check available populations

names(HMDdata)

## select Danish females deaths, ages 50-100, years 1950-2009

D <- selectHMDdata(country="Denmark",

data="Death",

sex="Females",

ages=50:100,

years=1950:2009)

## plot the data

plot(D)

D is a matrix where rows and columns are indexed by age and year, respectively.

Plotting an HMDdata object produces a shaded contour-map or a scatter plot for 2D and 1D datasets, respectively (log-scale in case of rates).

## INSTALLATION:

## with Linux

setwd("~/your_path/")

install.packages(pkg="HMDdata_1.0.tar.gz")

## with Windows

setwd("~\\your_path\\")

install.packages(pkg="HMDdata_1.0.zip")