quantityIndicator | R Documentation |
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")
quantityIndicator(x, pvar, qvar, pervar, prodID, method, sample = "matched")
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") |
an nx1 matrix containing the indicator
# compute a quantity indicator using the Bennet method
quantityIndicator(CES_sigma_2, pvar = "prices", qvar = "quantities",
prodID = "prodID", pervar = "time", method = "bennet")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.