Skip to contents

Calculates the Gheary Khamis "world prices" and the corresponding quantity index (normalized by the prices of the last good being set to unity).

Usage

gk(P, Q, pop = NULL)

Arguments

P

An m x n matrix (or dataframe) of prices (row country, column goods).

Q

An m x n matrix (or dataframe) of quantities (row country, column goods).

pop

Optional m-vector of population numbers (if Q is per capita).

Value

A list with two elements: pi, an n-vector of prices and y, an m-vector of incomes.

Details

For the Gheary Khamis index, it makes a difference whether the quantities are total country-numbers or if they are per capita numbers. If the quantity matrix is per capita, one should also supply a population vector for the proper weighting. If per capita quantities are supplied, the quantity index returned are also per capita.

Examples

P <- matrix(1:6, ncol = 2)
Q <- matrix(2:7, ncol = 2)
gk(P, Q)
#> $pi
#> [1] 0.4051666 1.0000000
#> 
#> $y
#> [1] 5.810333 7.215500 8.620666
#>