Learn R Programming

demography (version 1.02)

hmd.mx: Read Mx demographic data from the Human Mortality Database

Description

Reads "Mx" (1x1) data from the Human Mortality Database (http://www.mortality.org) and constructs a demogdata object suitable for plotting using plot.demogdata and fitting an LC or BMS model using lca or an FDA model using fdm.

Usage

hmd.mx(country, username, password, label = country)

Arguments

country
Directory abbreviation from the HMD. For instance, Australia = "AUS".
username
HMD username
password
HMD password
label
Character string giving name of country from which the data are taken.

Value

  • Object of class demogdata with the following components:
  • yearVector of years
  • ageVector of ages
  • rateA list containing one or more rate matrices with one age group per row and one column per year.
  • popA list of the same form as rate but containing population numbers instead of demographic rates.
  • typeType of object: mortality, fertility or migration.
  • labellabel

Details

In order to read the data, users are required to create their account via the HMD website (http://www.mortality.org), and obtain a valid username and password.

See Also

demogdata,read.demogdata

Examples

Run this code
norway <- hmd.mx("NOR", username, password, "Norway")
summary(norway)

Run the code above in your browser using DataLab