gk: Gheary Khamis world prices and quantity index

View source: R/indices.R

gkR Documentation

Gheary Khamis world prices and quantity index

Description

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).

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.

Value

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

Examples

P <- matrix(1:6, ncol = 2)
Q <- matrix(2:7, ncol = 2)
gk(P, Q)


ErikOSorensen/pppindexr documentation built on Jan. 7, 2023, 4:11 p.m.