Format data from the Human Cause-of-Death Database for use in the MortHump package
This is a data grabber for the Human Cause-of-death database that select and format age- and cause-specific death counts, exposures, rates and cause-of-death labels.
It formats the data so that they can be properly used by
HCD population letter code
year for which the data is required
sex for which the data is required ("females", "males" or "total")
cause-of-death classification ("short", "interm" or "full")
should the data be unabridged into single-year values
path to the HCD folder for local access
This function assumes that all the HCD data are stored into a single folder, containing itself country-specific folders. To constitute this folder, download the zipped datasets by country, and unzip the country folders. The list of available countries and period coverage can be found on the HCD website.
HCD2MH returns a list of six elements:
a matrix of cause- and age-specific death rates (age in rows, causes in columns)
a matrix of cause- and age-specific death counts (age in rows, causes in columns)
a vector of age-specific exposures
a vector of mid-point for each age interval
a character vector of age labels
a matrix containing the endpoints of the age intervals
a character vector of short names for the causes of death
Human Cause-of-Death Database. French Institute for Demographic Studies (France) and Max Planck Institute for Demographic Research (Germany). Available at www.causeofdeath.org (data downloaded in May 2016).
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.