priceIndexNum: Price index numbers

priceIndexNumR Documentation

Price index numbers

Description

priceIndexNum computes price indices given data on products over time (prices and quantities)

Usage

priceIndexNum(x, prodID, pervar, pvar, qvar, base, indexMethod = "laspeyres", 
              output = "fixedBase", ...)

Arguments

x

Data frame containing, at least, the characteristics (time, location, ...), the product identifiers, the prices and the quantities.

prodID

Character string for the name of the product identifier.

pervar

Character string for the name of the factor variable with the characteristics.

pvar

Character string for the name of the price variable.

qvar

Character string for the name of the quantity variable.

base

Character string for the name of the base characteristic.

indexMethod

Character vector to select the price index method. Tipical price index methods are laspeyres (default), paasche, and fisher, but it can also be use those in function priceIndex from package IndexNumR (dutot, carli, jevons, cswd, harmonic, tornqvist, satovartia, walsh and CES).

output

A character string specifying whether a chained (output="chained") , fixed base (output="fixedBase") or period-on-period (output="pop") price index numbers should be returned. Default is fixed base.

...

Further arguments passed to or from other methods.

Details

priceIndexNum uses the function priceIndex from package IndexNumR without restricting the argument pervar from being integers starting at period 1 (base) and increasing in increments of 1 period.

Value

priceIndexNum returns a data frame with one column with the characteristic variable plus as many columns as indexMethod selected:

period

The characteristic variable.

laspeyres

The price index computed by the Laspeyres method.

paasche

The price index computed by the Paasche method.

fisher

The price index computed by the Fisher method.

...

See Also

priceIndex, Sindex, Deflat, ComplexIN.

Examples

library(IndexNumR)
data(Prices, package = "RcmdrPlugin.TeachStat")

priceIndexNum(Prices, prodID = "prodID", pervar = "year", pvar = "price", 
              qvar = "quantity", base = "2003", 
              indexMethod = c("laspeyres", "paasche", "fisher"))

RcmdrPlugin.TeachStat documentation built on Nov. 14, 2023, 5:08 p.m.