quantityIndicator: Compute a quantity indicator

View source: R/indicator.R

quantityIndicatorR Documentation

Compute a quantity indicator

Description

This calculates a quantity 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

quantityIndicator(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 quantity 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 quantity indicator using the Bennet method
quantityIndicator(CES_sigma_2, pvar = "prices", qvar = "quantities",
prodID = "prodID", pervar = "time", method = "bennet")

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