bilateral.index {pricelevels} | R Documentation |
Bilateral price indices
Description
Calculation of bilateral price indices. Currently, the following ones are implemented (see below in alphabetic order).
Usage
banerjee(p, r, n, q, base=NULL, settings=list())
bmw(p, r, n, base=NULL, settings=list())
carli(p, r, n, base=NULL, settings=list())
cswd(p, r, n, base=NULL, settings=list())
davies(p, r, n, q, base=NULL, settings=list())
drobisch(p, r, n, q, w=NULL, base=NULL, settings=list())
dutot(p, r, n, base=NULL, settings=list())
fisher(p, r, n, q, w=NULL, base=NULL, settings=list())
geolaspeyres(p, r, n, q, w=NULL, base=NULL, settings=list())
geopaasche(p, r, n, q, w=NULL, base=NULL, settings=list())
geowalsh(p, r, n, q, w=NULL, base=NULL, settings=list())
harmonic(p, r, n, base=NULL, settings=list())
jevons(p, r, n, base=NULL, settings=list())
laspeyres(p, r, n, q, w=NULL, base=NULL, settings=list())
lehr(p, r, n, q, base=NULL, settings=list())
lowe(p, r, n, q, base=NULL, settings=list())
medgeworth(p, r, n, q, base=NULL, settings=list())
paasche(p, r, n, q, w=NULL, base=NULL, settings=list())
palgrave(p, r, n, q, w=NULL, base=NULL, settings=list())
svartia(p, r, n, q, w=NULL, base=NULL, settings=list())
toernqvist(p, r, n, q, w=NULL, base=NULL, settings=list())
theil(p, r, n, q, w=NULL, base=NULL, settings=list())
uvalue(p, r, n, q, base=NULL, settings=list())
walsh(p, r, n, q, w=NULL, base=NULL, settings=list())
young(p, r, n, q, base=NULL, 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. If |
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
A named vector of price levels.
Author(s)
Sebastian Weinand
References
ILO, IMF, OECD, UNECE, Eurostat and World Bank (2020). Consumer Price Index Manual: Concepts and Methods. Washington DC: International Monetary Fund.
Examples
# sample complete price data:
set.seed(123)
dt1 <- rdata(R=3, B=1, N=5)
# compute jevons and toernqvist index:
dt1[, jevons(p=price, r=region, n=product, base="1")]
dt1[, toernqvist(p=price, r=region, n=product, q=quantity, base="1")]
# compute lowe index using quantities of region 2:
dt1[, lowe(p=price, r=region, n=product, q=quantity, base="1",
settings=list(qbase="2"))]
# 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 jevons and toernqvist index:
dt[, jevons(p=price, r=region, n=product, base="1")]
# change base region:
dt[, jevons(p=price, r=region, n=product, base="4")]