Title: | Health Metrics and the Spread of Infectious Diseases |
---|---|
Description: | A collection of datasets and supporting functions accompanying Health Metrics and the Spread of Infectious Diseases by Federica Gazzelloni (2024). This package provides data for health metrics calculations, including Disability-Adjusted Life Years (DALYs), Years of Life Lost (YLLs), and Years Lived with Disability (YLDs), as well as additional tools for analyzing and visualizing health data. Federica Gazzelloni (2024) <doi:10.5281/zenodo.10818338>. |
Authors: | Federica Gazzelloni [aut, cre] |
Maintainer: | Federica Gazzelloni <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.1.2 |
Built: | 2024-11-19 10:30:43 UTC |
Source: | https://github.com/fgazzelloni/hmsidwr |
A dataset containing the number of Deaths due to 9 causes in 6 regions for 2019.
data(deaths2019)
data(deaths2019)
A dataframe with 2754 rows and 7 variables:
The variables are as follows:
character, France, Germany, Global, Italy, United Kingdom, United States of America
character, Female, Male, Both
character, age groups from <1 to 85+ each 5 years
character, Alzheimer's disease and other dementias, Breast cancer, Chronic obstructive pulmonary disease, Colon and rectum cancer, Diabetes and kidney diseases, Lower respiratory infections, Road injuries, Stroke, Tracheal, bronchus, and lung cancer
numeric, deaths number estimation
numeric, upper value estimation
numeric, lower value estimation
2019 data from the IHME website
data(deaths2019) head(deaths2019)
data(deaths2019) head(deaths2019)
Health Metrics Data - Number of Deaths Due to 9 Causes in 6 Locations for the Years 2011 and 2021.
data(deaths9)
data(deaths9)
A dataframe with 5112 rows and 7 variables:
The variables are as follows:
character, France, Germany, Global, Italy, UK, USA
character, country code
character, female, male, both
character, 5-year age groups from <5 to 85+
character, Alzheimer's disease and other dementias, Breast cancer, Chronic obstructive pulmonary disease, Colon and rectum cancer, Diabetes and kidney diseases, Lower respiratory infections, Road injuries, Stroke, Tracheal, bronchus, and lung cancer
integer, years 2011 and 2019
numeric, deaths number estimation
2021 data from the IHME website
data(deaths9) head(deaths9)
data(deaths9) head(deaths9)
A dataset containing the Disability Weights estimates, upper and lower values, and the Severity level for Stroke, Tuberculosis, and HIV for all countries.
disweights
disweights
A dataframe with 463 rows and 9 variables:
The variables are as follows:
character, disease sequela
character, diesase specification
character, first cause of disease - morbidity
character, second cause of disease - morbidity
character, mild, moderate, severe, mean
numeric, disability weights estimation
numeric, upper value estimation
numeric, lower value estimation
Global Burden of Disease Collaborative Network. Global Burden of Disease Study 2019 and 2021 Disability Weights. Seattle, United States of America: Institute for Health Metrics and Evaluation (IHME), 2024.
A subset of data from the IHME GBD on Deaths, Disability-Adjusted Life Years (DALYs), Years of Life Lost (YLLs), and Years Lived with Disability (YLDs), Incidence and Prevalence, age standardized for all causes and respiratory infections and tuberculosis. For years 2010, 2019 and 2021.
g7_hmetrics
g7_hmetrics
A dataframe with 3402 rows and 9 variables:
The variables are as follows:
character, metric name
character, country
character, Female, Male, Both
character, all causes, and respiratory infections and tuberculosis
integer, year
numeric, estimated values
numeric, estimated upper values
numeric, estimated lower values
Locations available are Global, Canada, France, Germany, Italy, Japan, UK, and US.
https://vizhub.healthdata.org/gbd-results/
This function fetches data from the GBD API. To use this function, you need to have an API key. You can get the key by registering on the IHME-API website.
gbd_get_data(url, key, endpoint, ...)
gbd_get_data(url, key, endpoint, ...)
url |
The base URL of the API. |
key |
The API key for authorization. |
endpoint |
The specific endpoint to retrieve data from. |
... |
Additional query parameters such as location_id, year, etc. |
A data frame or list of results from the API.
## Not run: # This is a dontrun example because it requires an API KEY. url <- "https://api.healthdata.org/sdg/v1" key <- "YOUR-KEY" endpoint <- "GetResultsByIndicator" data <- gbd_get_data(url, key, endpoint, indicator_id="1001", location_id= c("29","86","102"), year="2019", limit = 10) ## End(Not run)
## Not run: # This is a dontrun example because it requires an API KEY. url <- "https://api.healthdata.org/sdg/v1" key <- "YOUR-KEY" endpoint <- "GetResultsByIndicator" data <- gbd_get_data(url, key, endpoint, indicator_id="1001", location_id= c("29","86","102"), year="2019", limit = 10) ## End(Not run)
A dataset containing deaths number due to lungcancer in Germany 2019.
germany_lungc
germany_lungc
A dataframe with 48 rows and 8 variables:
The variables are as follows:
character, age groups from 10-14 to 85+ each 5 years
character, both, male, female
numeric, prevalence rate estimation due to lungcancer
numeric, upper value estimation
numeric, lower value estimation
numeric, deaths rate estimation due to lungcancer
numeric, upper value estimation
numeric, lower value estimation
2019 data from the IHME website
Download, Unzip and Read Data: getunz
getunz(url)
getunz(url)
url |
A url string for a .zip file. |
A dataframe object from a zipped file. Particulary useful For downloading data from IHME GBD Results: "https://vizhub.healthdata.org/gbd-results/". The function takes the url, creates a temp directory, unzip the file, if more than one csv files is available, it lists the files, and reads them.
Select a dataset from the IHME GBD results and download it. You will receive an email with a url. Use the url to download the data.
## Not run: # This is a dontrun example because it requires a valid url. url <- "https://www.healthdata.org/.../some-file.zip" getunz(url) ## End(Not run)
## Not run: # This is a dontrun example because it requires a valid url. url <- "https://www.healthdata.org/.../some-file.zip" getunz(url) ## End(Not run)
A dataset containing World countries Life Expectancy and HALE from 2000 to 2019.
gho_le_hale
gho_le_hale
A dataframe with 8784 rows and 6 variables:
The variables are as follows:
character, Healthy life expectancy (HALE) at age 60 (years),
Healthy life expectancy (HALE) at birth (years),
Life expectancy at age 60 (years),
Life expectancy at birth (years)
numeric, from 2000 to 2019
character, 6 World regions: Africa, Americas, Eastern Mediterranean, Europe, South-East Asia, and Western Pacific
character, 183 World countries
character, both, male, female
numeric, value of the indicator
A dataset containing the Global region Life tables from 2000 to 2019.
gho_lifetables
gho_lifetables
A dataframe with 1995 rows and 5 variables:
The variables are as follows:
character, Tx - person-years lived above age x,
ex - expectation of life at age x,
lx - number of people left alive at age x,
nLx - person-years lived between ages x and x+n,
nMx - age-specific death rate between ages x and x+n,
ndx - number of people dying between ages x and x+n,
nqx - probability of dying between ages x and x+n
numeric, from 2000 to 2019
character, from <1 to 85+ each 5 years
character, both, male, female
numeric, value of the tables
A dataset containing average values for deaths rates, Disability-Adjusted Life Years (DALYs), Years of Life Lost (YLLs), and Years Lived with Disability (YLDs) due to 37 infectious diseases form 1980 to 2012 for all countries.
id_affected_countries
id_affected_countries
A dataframe with 3066 rows and 6 variables:
The variables are as follows:
character, list of countries
numeric, from 1980 to 2021
numeric, DALYs for 100 000
numeric, YLLs for 100 000
numeric, YLDs for 100 000
numeric, deaths rate
IHME website
Dataset: Health Metrics Data - Simple Feature Collection Average Disability-Adjusted Life Years (DALYs) per 100,000 population from 1990 to 2021
idDALY_map_data
idDALY_map_data
A Simple feature collection with 1402 rows and 4 variables:
double, country's polygon
character, 200 Countries affected by Infectious Diseases
double, Average DALYs per 100,000 population from 1990 to 2021
POLYGON
2021 data from the IHME website
Global Region Health Metrics Data - Incidence and Prevalence for Stroke 2019 and 2021 Numbers - 5-year age groups from <1 to 85+ and both Location available Global
incprev_stroke
incprev_stroke
A dataframe with 228 rows and 7 variables:
The variables are as follows:
character, metric name
character, female, male, both
character, age groups from <1 to 85+ each 5 years
integer, years 2019 and 2021
numeric, estimated values
numeric, estimated upper values
numeric, estimated lower values
https://vizhub.healthdata.org/gbd-results/
A dataset containing Deaths rates, Disability-Adjusted Life Years (DALYs), Years of Life Lost (YLLs), and Years Lived with Disability (YLDs), Prevalence and Incidence due to Infectious Diseases form 1980 to 2021 for Lesotho, Eswatini, Malawi, Central African Republic, and Zambia.
infectious_diseases
infectious_diseases
A dataframe with 7470 rows and 10 variables:
The variables are as follows:
numeric, from 1980 to 2021
character, list of countries
numeric, list of countries by id
character, type of infectious disease
numeric, deaths rate
numeric, DALYs for 100 000
numeric, YLDs for 100 000
numeric, YLLs for 100 000
numeric, prevalence rate
numeric, incidence rate
numeric, estimated values
IHME website
Kriging Best Fit: kbfit - Fit variogram models and kriging models to spatial data and select the best model based on the metrics values
kbfit(response, formula, data, models, initial_values)
kbfit(response, formula, data, models, initial_values)
response |
A character string specifying the response variable |
formula |
A formula object specifying the model to fit: response ~ predictors |
data |
A simple feature object containing the variables in the formula |
models |
A list of characters vector specifying the variogram models to fit |
initial_values |
A list of named numeric vectors specifying the initial values for the variogram models: psill, range, nugget |
A list with two elements: all_models and best_model
## Not run: # This is a dontrun example because it requires a spatial data object(data_sf). # Try different initial values for fitting the variogram models initial_values <- list( list(psill = 1, range = 100000, nugget = 10), list(psill = 0.5, range = 50000, nugget = 5), list(psill = 2, range = 150000, nugget = 15) ) # Set some models to fit models <- c("Sph", "Exp", "Gau") # Select Best: Fit variogram models and kriging models result <- hmsidwR::kbfit(response = "response", formula = response ~ predictor1 + predictor2, data = data_sf, models = c("Sph", "Exp", "Gau", "Mat"), initial_values = initial_values) result$all_models result$best_model ## End(Not run)
## Not run: # This is a dontrun example because it requires a spatial data object(data_sf). # Try different initial values for fitting the variogram models initial_values <- list( list(psill = 1, range = 100000, nugget = 10), list(psill = 0.5, range = 50000, nugget = 5), list(psill = 2, range = 150000, nugget = 15) ) # Set some models to fit models <- c("Sph", "Exp", "Gau") # Select Best: Fit variogram models and kriging models result <- hmsidwR::kbfit(response = "response", formula = response ~ predictor1 + predictor2, data = data_sf, models = c("Sph", "Exp", "Gau", "Mat"), initial_values = initial_values) result$all_models result$best_model ## End(Not run)
A subset of data from the IHME GBD on Disability-Adjusted Life Years (DALYs) and Deaths due to All Causes and Rabies. Locations available are Global Region and Asia.
rabies
rabies
A dataframe with 296 rows and 7 variables:
The variables are as follows:
character, metric name
character, country
character, cause
integer, year
numeric, estimated values
numeric, estimated upper values
numeric, estimated lower values
A subset of data from the IHME GBD containing location, year and estimated values of the SDI for the years 1990 and 2019.
sdi90_19
sdi90_19
A dataframe with 20010 rows and 3 variables:
The variables are as follows:
character, country
integer, year
numeric, estimated values
<healthdata.org>
Health Metrics Data - Disability-Adjusted Life Years (DALYs) Estimations for 204 countries in 2021 with spatial information.
data(spatialdalys2021)
data(spatialdalys2021)
A dataframe with 92862 rows and 7 variables:
The variables are as follows:
character, France, Germany, Global, Italy, UK, USA, ...
double, DALYs number estimation
double, DALYs number estimation lower bound
double, DALYs number estimation upper bound
double, longitude
double, latitude
double, polygons' group
2021 data from the IHME website
data(spatialdalys2021) head(spatialdalys2021)
data(spatialdalys2021) head(spatialdalys2021)
Scan all folders and files to find a string: string_search
string_search(path = ".", pattern, string)
string_search(path = ".", pattern, string)
path |
If NULL, the current directory is used |
pattern |
A regular expression pattern such as '\.R$' |
string |
A string such as 'metric' |
A character vector with the names of the files that contain the string
string_search(path=".","\\.R$","metric") # function string_search
string_search(path=".","\\.R$","metric") # function string_search
Custom ggplot2 theme function
theme_hmsid( base_size, text_size, subtitle_size, subtitle_margin, plot_title_size, plot_title_margin, ... )
theme_hmsid( base_size, text_size, subtitle_size, subtitle_margin, plot_title_size, plot_title_margin, ... )
base_size |
base font size |
text_size |
plot text size |
subtitle_size , subtitle_margin
|
plot subtitle size and margin |
plot_title_size , plot_title_margin
|
plot title size and margin |
... |
Other arguments passed to |
A customized theme for a ggplot object.
library(ggplot2) dat <- data.frame( x = seq_along(1:5), y = rnorm(n = 5, mean = 0.5, sd = 1) ) dat |> ggplot(aes(x = x, y = y)) + geom_line() + hmsidwR::theme_hmsid()
library(ggplot2) dat <- data.frame( x = seq_along(1:5), y = rnorm(n = 5, mean = 0.5, sd = 1) ) dat |> ggplot(aes(x = x, y = y)) + geom_line() + hmsidwR::theme_hmsid()