Learn R Programming

IndexNumR (version 0.1.3)

quantityIndex: Computes a bilateral quantity index

Description

A function to compute a quantity index given data on products over time

Usage

quantityIndex(x, pvar, qvar, pervar, indexMethod = "laspeyres", prodID,
  sample = "matched", output = "pop", chainMethod = "pop",
  sigma = 1.0001, ...)

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 dutot, carli, jevons, laspeyres, paasche, fisher, cswd, harmonic, tornqvist, satovartia, walsh and CES.

prodID

A character string for the name of the product identifier

sample

A character string specifying whether a matched sample should be used.

output

A character string specifying whether a chained, fixed base or period-on-period price index numbers should be returned.

chainMethod

A character string specifying the method of chain linking to use if the output option is set to "chained". Valid options are "pop" for period-on-period, and similarity chain linked options "plspread" for the Paasche-Laspeyres spread, "asymplinear" for weighted asymptotically linear, "logquadratic" for the weighted log-quadratic, and "mixScale" for the mix, scale or absolute dissimilarity measures. The default is period-on-period. Additional parameters can be passed to the mixScaleDissimilarity function using ...

sigma

The elasticity of substitution for the CES index method.

...

this is used to pass additional parameters to the mixScaleDissimilarity function.

Examples

Run this code
# NOT RUN {
# chained Fisher quantity index for the CES_sigma_2 dataset
quantityIndex(CES_sigma_2, pvar="prices", qvar="quantities", pervar="time",
prodID = "prodID", indexMethod = "fisher", output="chained")
# }

Run the code above in your browser using DataLab