GEKSIndex: Compute a GEKS multilateral index

Description Usage Arguments Details References Examples

View source: R/GEKS_functions.R

Description

A function to calculate a GEKS multilateral price index

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
GEKSIndex(
  x,
  pvar,
  qvar,
  pervar,
  indexMethod = "tornqvist",
  prodID,
  unique_prodID = NULL,
  sample = "matched",
  window = 13,
  splice = "mean"
)

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 or tornqvist. The default is tornqvist.

prodID

A character string for the name of the product identifier, or vector of names of features when calculating 'impute-tornqvist'

unique_prodID

A character string for the name of the unqiue 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 GEKS window.

splice

A character string specifying the splicing method. Valid methods are window, movement or mean. The default is mean.

Details

The splicing methods are used to update the price index when new data become available without changing prior index values. The window and movement splicing methods first calculate an 'update factor' by calculating the ratio of the final index value in the new GEKS window to some base period and then multiply the relevant old GEKS index value by the update factor. Alternatives are "window","movement","half", and "mean". See the package vignette for more information.

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.

Examples

1
2
3
4
5
6
7
# 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")

MjStansfi/GEKS_package documentation built on May 12, 2021, 8:44 p.m.