Skip to contents

Process data on age-specific mortality rates from a zipped file downloaded from the Human Mortality Database.

Usage

data_ssvd_hmd(zipfile, n_comp = 10)

Arguments

zipfile

The name of a zipped file downloaded from the Human Mortality Database. A path name that is handled by utils::unzip().

n_comp

Number of SVD components to include in result. Default is 10.

Value

A tibble with the format required by function bage::ssvd().

Usage

Step 1: Download data

Register or log in at the Human Mortality Database, and go to page Downloading the HMD in zipped data files. Go to the "Previous Versions" table at the bottom of the page, and download a file from the "Statistics" column, eg file

https://www.mortality.org/File/Download/hmd.v6/zip/all_hmd/hmd_statistics_20240226.zip

Step 2: Call function 'svd_hmd'

Put the file into the working directory, and supply the name of the file to function data_ssvd_hmd(), eg

data_hmd <- data_ssvd_hmd("hmd_statistcs_20240226")

See also

  • data_ssvd_hfd() Prepare data on age-specific fertility rates from Human Fertility Database

  • data_ssvd_lfs() Prepare data on labour force participation rates from the OCED

  • bage::ssvd() Create Scaled SVD object