priceIndicator: Calculate a price indicator

View source: R/indicator.R

priceIndicatorR Documentation

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")

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")

Value

an nx1 matrix containing the indicator

Examples

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

IndexNumR documentation built on Nov. 11, 2023, 1:07 a.m.