Learn R Programming

demography (version 1.11)

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

Description

hmd.mx 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. hmd.e0 reads life expectancy at birth from the Human Mortality Database and returns the result as a ts object.

Usage

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

Arguments

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

Value

  • hmd.mx returns an 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
  • hmd.e0 returns an object of class ts with columns male, female and total.

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. The country codes (as at 24 August 2010) are as follows. ll{ Australia AUS Austria AUT Belarus BLR Belgium BEL Bulgaria BGR Canada CAN Chile CHL Czech Republic CZE Denmark DNK Estonia EST Finland FIN France -- France total population FRATNP -- France civilian population FRACNP Germany -- Germany total population DEUTNP -- West Germany DEUTFRG -- East Germany DEUTGDR Hungary HUN Iceland ISL Ireland IRL Israel ISR Italy ITA Japan JPN Latvia LVA Lithuania LTU Luxembourg LUX Netherlands NLD New Zealand -- NZ total population NZL_NP -- NZ Maori NZL_MA -- NZ non-Maori NZL_NM Norway NOR Poland POL Portugal PRT Russia RUS Slovakia SVK Slovenia SVN Spain ESP Sweden SWE Switzerland CHE Taiwan TWN United Kingdom -- UK Total Population GBR_NP -- England & Wales Total Population GBRTENW -- England & Wales Civilian Population GBRCENW -- Scotland GBR_SCO -- Northern Ireland GBR_NIR U.S.A. USA Ukraine UKR } Later additions to the HMD are listed at http://www.mortality.org/cgi-bin/hmd/hmd_download.php.

See Also

demogdata,read.demogdata,life.expectancy

Examples

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

Run the code above in your browser using DataLab