priceIndexNum | R Documentation |
priceIndexNum
computes price indices given data on products over time (prices and quantities)
priceIndexNum(x, prodID, pervar, pvar, qvar, base, indexMethod = "laspeyres",
output = "fixedBase", ...)
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 |
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. |
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.
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. |
... |
priceIndex
, Sindex
, Deflat
, ComplexIN
.
library(IndexNumR)
data(Prices, package = "RcmdrPlugin.TeachStat")
priceIndexNum(Prices, prodID = "prodID", pervar = "year", pvar = "price",
qvar = "quantity", base = "2003",
indexMethod = c("laspeyres", "paasche", "fisher"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.