Skip to contents

index_gex() in OECDsppps calculates the GEKS indices. It returns a data frame containing the base region, region, and the respective indices; see Details and World Bank (2013) , for more information.

Usage

index_geks(
  data,
  region = "region",
  product = "product",
  ppp_bh = "ppp_bh",
  exp_wght = "exp_wght",
  data_check_output = "truncated"
)

Arguments

data

A data frame or tibble containing at least four columns identifying region, product, subnational PPPs, and expenditure weights. The data is checked using valid_index_data() prior to index calculation.

region

Identifier for regions

product

Product identifier

ppp_bh

Identifier for subnational PPPs

exp_wght

Identifier for expenditure weights

data_check_output

controls the length of the possible error messages generated by valid_index_data() during the input data check. Default "truncated" might not list all problematic region/heading pairs. Under "full", the function increases the length of the warning message, so that all problematic region/heading pairs are printed.

Details

Subnational PPPs for region \(k\) with reference to region \(j\) are \[sPPP_G^{j,k} = \prod_{r=1}^R \left( sPPP_F^{j,r} \times sPPP_F^{r,k} \right)^{1/R}\] and correspond to the geometric average of the Fisher indices of all direct comparisons between region \(j\) and region k, and indirect comparisons across all regions \(r = 1, \dots, j, k, \dots, R\).

The function returns a data frame containing the following variables: 'base_region' (region j), 'region' (region k), 'geks_index' (final indices).

References

World Bank (2013). Measuring the Real Size of the World Economy: The Framework, Methodology, and Results of the International Comparison Program — ICP. World Bank. doi:10.1596/978-0-8213-9728-2 .

Examples

suppressPackageStartupMessages(library(dplyr))
suppressPackageStartupMessages(library(tibble))
tibble(
  region = c("region A", "region A", "region B", "region B"),
  product = c("product 1", "product 2", "product 1", "product 2"),
  ppp_bh = c(0.5, 0.7, 0.6, 0.9),
  exp_wght = c(0.5, 0.5, 0.6, 0.4)
) |>
  index_geks()
#> # A tibble: 4 × 3
#>   base_region region   geks_index
#>   <chr>       <chr>         <dbl>
#> 1 region A    region A      1    
#> 2 region A    region B      1.24 
#> 3 region B    region A      0.808
#> 4 region B    region B      1