Introduction

2022-08-30

rgho is an R package to access WHO GHO data from R via the GHO OData API, providing a simple query interface to the World Health Organization’s data and statistics content.

The Global Health Observatory

As stated by the WHO website: The GHO data repository contains an extensive list of indicators, which can be selected by theme or through a multi-dimension query functionality. It is the World Health Organization’s main health statistics repository.

Data structure

GHO data is composed of indicators structured in dimensions. The list of dimensions is available in vignette("b-dimensions", "rgho"), the list of indicators for the GHO dimension (the main dimension) in vignette("c-values-gho", "rgho")).

It is possible to access dimensions with get_gho_dimensions():

get_gho_dimensions()
## A 'GHO' object of 101 elements.
## 
##                   Code                                    Title
## 1      ADVERTISINGTYPE        SUBSTANCE_ABUSE_ADVERTISING_TYPES
## 2             AGEGROUP                                Age Group
## 3          ALCOHOLTYPE                           Beverage Types
## 4     AMRGLASSCATEGORY                       AMR GLASS Category
## 5              ARCHIVE                             Archive date
## 6 ASSISTIVETECHBARRIER Barriers to accessing assistive products
## ...
## 
## (Printing 6 first elements.)

And codes for a given dimension with get_gho_values():

get_gho_values(dimension = "COUNTRY")
## A 'GHO' object of 245 elements.
## 
##   Code       Title
## 1  ABW       Aruba
## 2  AFG Afghanistan
## 3  AGO      Angola
## 4  AIA    Anguilla
## 5  ALB     Albania
## 6  AND     Andorra
## ...
## 
## (Printing 6 first elements.)
get_gho_values(dimension = "GHO")
## A 'GHO' object of 2264 elements.
## 
##                      Code
## 1  Adult_curr_cig_smoking
## 2        Adult_curr_e-cig
## 3    Adult_curr_smokeless
## 4  Adult_curr_tob_smoking
## 5      Adult_curr_tob_use
## 6 Adult_daily_cig_smoking
##                                                          Title
## 1     Prevalence of current cigarette smoking among adults (%)
## 2       Prevalence of current e-cigarette use among adults (%)
## 3 Prevalence of current smokeless tobacco use among adults (%)
## 4       Prevalence of current tobacco smoking among adults (%)
## 5           Prevalence of current tobacco use among adults (%)
## 6       Prevalence of daily cigarette smoking among adults (%)
## ...
## 
## (Printing 6 first elements.)

Data download

An indicator can be downloaded as a data_frame with get_gho_data(). Here we use MDG_0000000001, Infant mortality rate (probability of dying between birth and age 1 per 1000 live births):

result <- get_gho_data(
  code = "MDG_0000000001"
)

print(result)
## A 'GHO' object of 35933 elements.
## 
##         Id  IndicatorCode                  Value NumericValue       Low
## 1 27816263 MDG_0000000001 105.51 [103.62-107.68]    105.51129 103.61955
## 2 27816264 MDG_0000000001     97.2 [95.33-99.33]     97.19640  95.32996
## 3 27816265 MDG_0000000001 113.41 [111.29-115.88]    113.41113 111.28832
## 4 27816266 MDG_0000000001 104.72 [102.87-106.84]    104.71737 102.86652
## 5 27816267 MDG_0000000001     96.4 [94.57-98.52]     96.39962  94.56988
## 6 27816268 MDG_0000000001  112.62 [110.55-115.0]    112.62281 110.55119
##        High                          Date TimeDimensionValue
## 1 107.68372 2022-01-18T13:12:40.993+01:00               1990
## 2  99.33017 2022-01-18T13:12:41.023+01:00               1990
## 3 115.87599  2022-01-18T13:12:41.04+01:00               1990
## 4 106.84179 2022-01-18T13:12:41.057+01:00               1991
## 5  98.51799  2022-01-18T13:12:41.07+01:00               1991
## 6 115.00073 2022-01-18T13:12:41.087+01:00               1991
##          TimeDimensionBegin          TimeDimensionEnd REGION COUNTRY YEAR  SEX
## 1 1990-01-01T00:00:00+01:00 1990-12-31T00:00:00+01:00    AFR    <NA> 1990 BTSX
## 2 1990-01-01T00:00:00+01:00 1990-12-31T00:00:00+01:00    AFR    <NA> 1990 FMLE
## 3 1990-01-01T00:00:00+01:00 1990-12-31T00:00:00+01:00    AFR    <NA> 1990  MLE
## 4 1991-01-01T00:00:00+01:00 1991-12-31T00:00:00+01:00    AFR    <NA> 1991 BTSX
## 5 1991-01-01T00:00:00+01:00 1991-12-31T00:00:00+01:00    AFR    <NA> 1991 FMLE
## 6 1991-01-01T00:00:00+01:00 1991-12-31T00:00:00+01:00    AFR    <NA> 1991  MLE
## ...
## 
## (Printing 6 first elements.)

Filter requests

The filter argument in get_gho_data() allows request filtering:

result <- get_gho_data(
  code = "MDG_0000000001",
  filter = list(
    REGION = "EUR",
    YEAR = 2015
  )
)

print(result)
## A 'GHO' object of 3 elements.
## 
##         Id  IndicatorCode            Value NumericValue     Low    High
## 1 27816617 MDG_0000000001  8.0 [7.76-8.28]      8.00280 7.75596 8.27904
## 2 27816618 MDG_0000000001 7.11 [6.89-7.37]      7.10611 6.88558 7.36740
## 3 27816619 MDG_0000000001 8.85 [8.57-9.17]      8.85070 8.56613 9.17291
##                            Date TimeDimensionValue        TimeDimensionBegin
## 1 2022-01-18T13:12:46.503+01:00               2015 2015-01-01T00:00:00+01:00
## 2  2022-01-18T13:12:46.52+01:00               2015 2015-01-01T00:00:00+01:00
## 3 2022-01-18T13:12:46.537+01:00               2015 2015-01-01T00:00:00+01:00
##            TimeDimensionEnd REGION YEAR  SEX
## 1 2015-12-31T00:00:00+01:00    EUR 2015 BTSX
## 2 2015-12-31T00:00:00+01:00    EUR 2015 FMLE
## 3 2015-12-31T00:00:00+01:00    EUR 2015  MLE

Other parameters

For details about how the requests are performed and the options available (especially proxy settings) see vignette("e-details", "rgho").