gk | R Documentation |
Calculates the Gheary Khamis "world prices" and the corresponding quantity index (normalized by the prices of the last good being set to unity).
gk(P, Q, pop = NULL)
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). |
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.
A list with two elements: pi, an n-vector of prices and y, an m-vector of incomes.
P <- matrix(1:6, ncol = 2) Q <- matrix(2:7, ncol = 2) gk(P, Q)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.