gerardi {pricelevels} | R Documentation |
Gerardi index
Description
Calculation of regional price levels using the multilateral Gerardi index (Eurostat, 1978).
Usage
gerardi(p, r, n, q, w=NULL, base=NULL, simplify=TRUE, settings=list())
Arguments
p |
A numeric vector of prices. |
r , n |
A character vector or factor of regional entities |
q , w |
A numeric vector of non-negative quantities |
base |
A character specifying the base region to which all price levels are expressed. When |
simplify |
A logical indicating whether a named vector of estimated regional price levels ( |
settings |
A list of control settings to be used. The following settings are supported:
|
Details
Before calculations start, missing values are excluded and duplicated observations for r
and n
are aggregated, that is, duplicated prices p
and weights w
are averaged and duplicated quantities q
added up.
The weights w
must represent expenditure shares defined as w_i^r = p_i^r q_i^r / \sum_{j=1}^{N} p_j^r q_j^r
. They are internally (re-)normalized such that they add up to 1 for each region r
.
Value
For simplify=TRUE
, a named vector of regional price levels. Otherwise, for simplify=FALSE
, a list containing the named vector of international product prices and regional price levels.
Author(s)
Sebastian Weinand
References
Balk, B. M. (1996). A comparison of ten methods for multilateral international price and volume comparisons. Journal of Official Statistics, 12 (1), 199-222.
Eurostat (1978), Comparison in real values of the aggregates of ESA 1975, Publications Office, Luxembourg.
Examples
require(data.table)
# example data:
set.seed(123)
dt1 <- rdata(R=3, B=1, N=5)
# Gerardi price index:
dt1[, gerardi(p=price, q=quantity, r=region, n=product)]
# add price data:
dt2 <- rdata(R=4, B=1, N=4)
dt2[, "region":=factor(region, labels=4:7)]
dt2[, "product":=factor(product, labels=6:9)]
dt <- rbind(dt1, dt2)
dt[, is.connected(r=region, n=product)] # non-connected now
# compute expenditure share weights:
dt[, "share" := price*quantity/sum(price*quantity), by="region"]
# Gerardi index with quantites or expenditure share weights:
dt[, gerardi(p=price, q=quantity, r=region, n=product)]
dt[, gerardi(p=price, w=share, r=region, n=product)]