Learn R Programming

IndexNumR (version 0.6.0)

priceIndicator: Calculate a price indicator

Description

This calculates a price indicator. This is calculated using the differences approach to index number theory, where the change in prices and quantities from one period to the next is additive. Therefore, the change in total value is the sum of the change in prices and the change in quantities. Such a value decomposition can be obtained using valueDecomposition.

See the vignette for more information on the calculations.

vignette(topic = "indexnumr", package = "IndexNumR")

Usage

priceIndicator(x, pvar, qvar, pervar, prodID, method, sample = "matched")

Value

an nx1 matrix containing the indicator

Arguments

x

data frame with input data

pvar

character string for the name of the price column

qvar

character string for the name of the quantity column

pervar

character string for the name of the time period variable

prodID

character string for the name of the product ID column

method

character string for the indicator method. Valid options are "laspeyres", "paasche", "bennet", or "montgomery".

sample

whether to use a matched sample (sample = "matched")

Examples

Run this code
# compute a price indicator using the Montgomery method
priceIndicator(CES_sigma_2, pvar = "prices", qvar = "quantities",
prodID = "prodID", pervar = "time", method = "montgomery")

Run the code above in your browser using DataLab