rgho is an R package to access WHO GHO data from R via the Athena web service, an 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("dimensions", package = "rgho"), the list of indicators for the GHO dimension (the main dimension) in vignette("codes-gho", package = "rgho")).

It is possible to access dimensions with get_gho_dimensions():

get_gho_dimensions()
## A 'GHO' object of 112 elements.
## 
##                  Label              ID
## 1            Indicator             GHO
## 2 Indicator Categories          GHOCAT
## 3          Data Source      DATASOURCE
## 4          Child cause  GBDCHILDCAUSES
## 5      ICD10CAUSEGROUP ICD10CAUSEGROUP
## 6         ICD10CHAPTER    ICD10CHAPTER
## ...
## 
## (Printing 6 first elements.)

And codes for a given dimension with get_gho_codes():

get_gho_codes(dimension = "COUNTRY")
## A 'GHO' object of 247 elements.
## 
##                 Label  ID
## 1         Afghanistan AFG
## 2             Albania ALB
## 3             Algeria DZA
## 4             Andorra AND
## 5              Angola AGO
## 6 Antigua and Barbuda ATG
## ...
## 
## (Printing 6 first elements.)
## 
## Attributes:
## 
## DS
## FIPS
## GEOMETRY
## IOC
## ISO
## ISO2
## ITU
## LAND_AREA_KMSQ_2012
## LANGUAGES_EN_2012
## MARC
## MORT
## SHORTNAMEES
## SHORTNAMEFR
## WHO
## WHOLEGALSTATUS
## WHO_REGION
## WHO_REGION_CODE
## WMO
## WORLD_BANK_INCOME_GROUP
## WORLD_BANK_INCOME_GROUP_CODE
## WORLD_BANK_INCOME_GROUP_GNI_REFERENCE_YEAR
## WORLD_BANK_INCOME_GROUP_RELEASE_DATE
get_gho_codes(dimension = "GHO")
## A 'GHO' object of 2160 elements.
## 
##                                                                                       Label
## 1 Infant mortality rate (probability of dying between birth and age 1 per 1000 live births)
## 2                               Adolescent fertility rate (per 1000 girls aged 15-19 years)
## 3                                                              Contraceptive prevalence (%)
## 4                                                        Unmet need for family planning (%)
## 5            Under-five mortality rate (probability of dying by age 5 per 1000 live births)
## 6                            Median availability of selected generic medicines (%) - Public
##               ID
## 1 MDG_0000000001
## 2 MDG_0000000003
## 3 MDG_0000000005
## 4 MDG_0000000006
## 5 MDG_0000000007
## 6 MDG_0000000010
## ...
## 
## (Printing 6 first elements.)
## 
## Attributes:
## 
## CATEGORY
## DEFINITION_XML
## DISPLAY_ES
## DISPLAY_FR
## IMR_ID
## RENDERER_ID

Filtering results

Dimension codes can be filtered according to their attributes.

results <- get_gho_codes(dimension = "COUNTRY")

filter_attrs(
  results,
  WHO_REGION_CODE == "EUR"
)
## A 'GHO' object of 53 elements.
## 
##        Label  ID
## 1    Albania ALB
## 2    Andorra AND
## 3    Armenia ARM
## 4    Austria AUT
## 5 Azerbaijan AZE
## 6    Belarus BLR
## ...
## 
## (Printing 6 first elements.)
## 
## Attributes:
## 
## DS
## FIPS
## GEOMETRY
## IOC
## ISO
## ISO2
## ITU
## LAND_AREA_KMSQ_2012
## LANGUAGES_EN_2012
## MARC
## MORT
## SHORTNAMEES
## SHORTNAMEFR
## WHO
## WHOLEGALSTATUS
## WHO_REGION
## WHO_REGION_CODE
## WMO
## WORLD_BANK_INCOME_GROUP
## WORLD_BANK_INCOME_GROUP_CODE
## WORLD_BANK_INCOME_GROUP_GNI_REFERENCE_YEAR
## WORLD_BANK_INCOME_GROUP_RELEASE_DATE

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(
  dimension = "GHO",
  code = "MDG_0000000001"
)

print(result, width = Inf)
## Source: local data frame [5,330 x 11]
## 
##               GHO PUBLISHSTATE  YEAR REGION WORLDBANKINCOMEGROUP COUNTRY
##             (chr)        (chr) (int)  (chr)                (chr)   (chr)
## 1  MDG_0000000001    PUBLISHED  1998    AFR               WB_UMI     AGO
## 2  MDG_0000000001    PUBLISHED  2000    AFR               WB_UMI     AGO
## 3  MDG_0000000001    PUBLISHED  2015    AFR               WB_UMI     AGO
## 4  MDG_0000000001    PUBLISHED  1990    AFR                WB_LI     BDI
## 5  MDG_0000000001    PUBLISHED  2004    AFR                WB_LI     BDI
## 6  MDG_0000000001    PUBLISHED  2006    AFR                WB_LI     BDI
## 7  MDG_0000000001    PUBLISHED  1995    AFR                WB_LI     BEN
## 8  MDG_0000000001    PUBLISHED  1998    AFR                WB_LI     BEN
## 9  MDG_0000000001    PUBLISHED  2003    AFR                WB_LI     BEN
## 10 MDG_0000000001    PUBLISHED  2004    AFR                WB_LI     BEN
## ..            ...          ...   ...    ...                  ...     ...
##          Display Value Numeric   Low  High Comments
##                  (chr)   (dbl) (dbl) (dbl)    (chr)
## 1  130.6 [116.9-147.3]   130.6 116.9 147.3         
## 2  128.3 [113.9-145.8]   128.3 113.9 145.8         
## 3    96.0 [61.6-150.1]    96.0  61.6 150.1         
## 4   103.9 [95.2-113.8]   103.9  95.2 113.8         
## 5     82.9 [73.3-93.5]    82.9  73.3  93.5         
## 6     76.2 [65.6-87.9]    76.2  65.6  87.9         
## 7    97.2 [91.7-102.8]    97.2  91.7 102.8         
## 8     92.7 [87.4-98.6]    92.7  87.4  98.6         
## 9     83.0 [77.5-88.8]    83.0  77.5  88.8         
## 10    80.8 [75.0-86.8]    80.8  75.0  86.8         
## ..                 ...     ...   ...   ...      ...

Filter requests

The filter argument in get_gho_data() allows request filtering:

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

print(result, width = Inf)
## Source: local data frame [54 x 11]
## 
##               GHO PUBLISHSTATE  YEAR REGION WORLDBANKINCOMEGROUP COUNTRY
##             (chr)        (chr) (int)  (chr)                (chr)   (chr)
## 1  MDG_0000000001    PUBLISHED  2015    EUR                WB_HI     AUT
## 2  MDG_0000000001    PUBLISHED  2015    EUR               WB_UMI     AZE
## 3  MDG_0000000001    PUBLISHED  2015    EUR                WB_HI     DNK
## 4  MDG_0000000001    PUBLISHED  2015    EUR                WB_HI     ESP
## 5  MDG_0000000001    PUBLISHED  2015    EUR                WB_HI     HUN
## 6  MDG_0000000001    PUBLISHED  2015    EUR                WB_HI     POL
## 7  MDG_0000000001    PUBLISHED  2015    EUR               WB_UMI     ROU
## 8  MDG_0000000001    PUBLISHED  2015    EUR                WB_HI     CYP
## 9  MDG_0000000001    PUBLISHED  2015    EUR                WB_HI     CZE
## 10 MDG_0000000001    PUBLISHED  2015    EUR               WB_LMI     GEO
## ..            ...          ...   ...    ...                  ...     ...
##       Display Value Numeric   Low  High Comments
##               (chr)   (dbl) (dbl) (dbl)    (chr)
## 1     2.9 [2.6-3.2]     2.9   2.6   3.2         
## 2  27.9 [17.6-44.5]    27.9  17.6  44.5         
## 3     2.9 [2.4-3.5]     2.9   2.4   3.5         
## 4     3.5 [2.9-4.2]     3.5   2.9   4.2         
## 5     5.3 [4.8-5.9]     5.3   4.8   5.9         
## 6     4.5 [4.0-5.1]     4.5   4.0   5.1         
## 7    9.7 [8.7-10.9]     9.7   8.7  10.9         
## 8     2.5 [1.9-3.2]     2.5   1.9   3.2         
## 9     2.8 [2.5-3.1]     2.8   2.5   3.1         
## 10  10.6 [8.9-13.3]    10.6   8.9  13.3         
## ..              ...     ...   ...   ...      ...

Other parameters

Other parameters than format can be specified to get_gho_data() (such as apikey, asof…). Parameters are listed on this page. Note that most parameters are not available to general users.