GEKSIndex: Compute a GEKS multilateral index

View source: R/geks.R

GEKSIndexR Documentation

Compute a GEKS multilateral index

Description

A function to calculate a GEKS multilateral price index

Usage

GEKSIndex(
  x,
  pvar,
  qvar,
  pervar,
  indexMethod = "tornqvist",
  prodID,
  sample = "matched",
  window = 13,
  splice = "mean",
  biasAdjust = FALSE,
  weights = "average",
  intGEKS = FALSE,
  imputePrices = NULL
)

Arguments

x

A dataframe containing price, quantity, a time period identifier and a product identifier. It must have column names.

pvar

A character string for the name of the price variable

qvar

A character string for the name of the quantity variable

pervar

A character string for the name of the time variable. This variable must contain integers starting at period 1 and increasing in increments of 1 period. There may be observations on multiple products for each time period.

indexMethod

A character string to select the index number method. Valid index number methods are fisher, tornqvist, tpd, jevons or walsh. The default is tornqvist.

prodID

A character string for the name of the product identifier

sample

A character string specifying whether matching is to be performed. The default is to use matching. If sample=matched then any products that are not present in comparison periods are removed prior to estimating the index for those periods.

window

An integer specifying the length of the window.

splice

A character string specifying the splicing method. Valid methods are window, movement, half, mean, fbew or fbmw, wisp, hasp or mean_pub. The default is mean. See details for important considerations when using fbew and fbmw.

biasAdjust

whether to adjust for bias in the coefficients of the bilateral TPD index. The default is FALSE because making this adjustment will break transitivity of the GEKS index.

weights

the type of weighting for the bilateral TPD index. Options are "unweighted" to use ordinary least squares, "shares" to use weighted least squares with expenditure share weights, and "average" to use weighted least squares with the average of the expenditure shares over the two periods. See details for more information

intGEKS

whether to estimate the intersection GEKS method. This method performs additional product matching over the sample = "matched" option. See Lamboray and Krsinich 2015 for more information.

imputePrices

the type of price imputation to use for missing prices. Currently only "carry" is supported to used carry-forward/carry-backward prices. Default is NULL to not impute missing prices.

Details

The splicing methods are used to update the price index when new data become available without changing prior index values. The window, movement, half and mean splices use the most recent index value as the base period, which is multiplied by a price movement computed using new data. The fbew (Fixed Base Expanding Window) and fbmw (Fixed Base Moving Window) use a fixed base onto which the price movement using new data is applied. The base period is updated periodically. IndexNumR calculates which periods are the base periods using seq(from = 1, to = n, by = window - 1), so the data must be set up correctly and the right window length chosen. For example, if you have monthly data and want December of each year to be the base period, then the first period in the data must be December and the window must be set to 13.

References

Ivancic, L., W.E. Diewert and K.J. Fox (2011), "Scanner Data, Time Aggregation and the Construction of Price Indexes", Journal of Econometrics 161, 24-35.

Lamboray, C. and F. Krsinich (2015), "A Modification of the GEKS Index When Product Turnover is High", Paper presented at the fourteenth Ottawa Group meeting, 20-22 May 2015, Tokyo, Japan.

Examples

# compute a GEKS mutlilateral index with mean splicing
GEKSIndex(CES_sigma_2, pvar = "prices", qvar = "quantities", pervar = "time",
prodID = "prodID", indexMethod = "tornqvist", window=11, splice = "mean")

# compute a GEKS multilateral index with window splicing and the Fisher index method
GEKSIndex(CES_sigma_2, pvar = "prices", qvar = "quantities", pervar = "time",
prodID = "prodID", indexMethod = "fisher", window=11, splice = "mean")


grahamjwhite/IndexNumR documentation built on Nov. 12, 2023, 6:44 p.m.