Introduction

2023-08-09

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 108 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 248 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 2359 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 37328 elements.
## 
##         Id  IndicatorCode                  Value NumericValue      Low     High
## 1 30548337 MDG_0000000001 105.66 [103.75-107.78]     105.6558 103.7520 107.7806
## 2 30548338 MDG_0000000001 104.74 [102.86-106.84]     104.7360 102.8642 106.8412
## 3 30548339 MDG_0000000001    103.92 [102.09-106]     103.9250 102.0883 106.0019
## 4 30548340 MDG_0000000001 103.09 [101.33-105.14]     103.0931 101.3256 105.1365
## 5 30548341 MDG_0000000001 102.96 [101.24-104.99]     102.9567 101.2391 104.9919
## 6 30548342 MDG_0000000001    100.9 [99.2-102.89]     100.8955  99.2008 102.8876
##                            Date TimeDimensionValue        TimeDimensionBegin
## 1 2023-02-16T07:30:20.313+01:00               1990 1990-01-01T00:00:00+01:00
## 2 2023-02-16T07:30:20.343+01:00               1991 1991-01-01T00:00:00+01:00
## 3 2023-02-16T07:30:20.373+01:00               1992 1992-01-01T00:00:00+01:00
## 4  2023-02-16T07:30:20.39+01:00               1993 1993-01-01T00:00:00+01:00
## 5  2023-02-16T07:30:20.42+01:00               1994 1994-01-01T00:00:00+01:00
## 6  2023-02-16T07:30:20.47+01:00               1995 1995-01-01T00:00:00+01:00
##            TimeDimensionEnd REGION COUNTRY YEAR  SEX
## 1 1990-12-31T00:00:00+01:00    AFR    <NA> 1990 BTSX
## 2 1991-12-31T00:00:00+01:00    AFR    <NA> 1991 BTSX
## 3 1992-12-31T00:00:00+01:00    AFR    <NA> 1992 BTSX
## 4 1993-12-31T00:00:00+01:00    AFR    <NA> 1993 BTSX
## 5 1994-12-31T00:00:00+01:00    AFR    <NA> 1994 BTSX
## 6 1995-12-31T00:00:00+01:00    AFR    <NA> 1995 BTSX
## ...
## 
## (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 30860630 MDG_0000000001 8.09 [7.84-8.37]      8.09124 7.83819 8.36952
## 2 30860982 MDG_0000000001 8.96 [8.67-9.28]      8.95834 8.66572 9.28486
## 3 30861334 MDG_0000000001 7.18 [6.95-7.44]      7.18045 6.95096 7.44140
##                            Date TimeDimensionValue        TimeDimensionBegin
## 1 2023-03-01T16:34:25.443+01:00               2015 2015-01-01T00:00:00+01:00
## 2  2023-03-01T16:34:32.47+01:00               2015 2015-01-01T00:00:00+01:00
## 3  2023-03-01T16:34:39.03+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  MLE
## 3 2015-12-31T00:00:00+01:00    EUR 2015 FMLE

Other parameters

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